char **ret = NULL;
int size = 0, alloc = 0;
unsigned int i;
char **ret = NULL;
int size = 0, alloc = 0;
unsigned int i;
guestfs_int_inotify_event_list *events;
char buf[PATH_MAX];
guestfs_int_inotify_event_list *events;
char buf[PATH_MAX];
if (len > 0 && buf[len-1] == '\n')
buf[len-1] = '\0';
if (len > 0 && buf[len-1] == '\n')
buf[len-1] = '\0';
- if (add_string (&ret, &size, &alloc, buf) == -1) {
- fclose (fp);
+ if (add_string (&ret, &size, &alloc, buf) == -1)
if (add_string (&ret, &size, &alloc, NULL) == -1)
goto error;
if (add_string (&ret, &size, &alloc, NULL) == -1)
goto error;
+ if (fp != NULL)
+ fclose (fp);
+
unlink ("/tmp/inotify");
return NULL;
#else
unlink ("/tmp/inotify");
return NULL;
#else