Change-Id: Idd6f721ba85836255211fc9064d5be963c8074e5
Signed-off-by: Junghoon Park <jh9216.park@samsung.com>
return;
watch->appid = strdup(appid);
- if (watch->appid == NULL)
+ if (watch->appid == NULL) {
+ free(watch);
return;
+ }
watch->pid = pid;
watch->fd = inotify_init();
if (watch->fd < 0) {
+ free(watch->appid);
free(watch);
return;
}
watch->wd = inotify_add_watch(watch->fd, buf, IN_CREATE);
if (watch->wd < 0) {
close(watch->fd);
+ free(watch->appid);
free(watch);
return;
}
if (watch->io == 0) {
inotify_rm_watch(watch->fd, watch->wd);
close(watch->fd);
+ free(watch->appid);
free(watch);
return;
}