summaryrefslogtreecommitdiff
path: root/watch_list.c
diff options
context:
space:
mode:
Diffstat (limited to 'watch_list.c')
-rw-r--r--watch_list.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/watch_list.c b/watch_list.c
index 7e23b93..39c61f2 100644
--- a/watch_list.c
+++ b/watch_list.c
@@ -80,8 +80,8 @@ int watch_list_add(watch_list_t* list, int watch_fd, const char* string)
tmp->next_->watch_fd_ = watch_fd;
tmp->next_->path_ = strdup(string);
if(!tmp->next_->path_) {
- free(list->first_);
- list->first_ = NULL;
+ free(tmp->next_);
+ tmp->next_ = NULL;
return -2;
}
}