This patch fixes a couple memory leaks.
In filesystem, g_file_get_contents allocates fresh memory to buf.
It needs to be freed after conversion to a GString object.
Destination was missed on an error path as is mld.
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
ret = verify_path(destdir);
g_free(destdir);
- if (ret < 0)
+ if (ret < 0) {
+ g_free(destination);
return ret;
+ }
source = g_build_filename(ftp->folder, name, NULL);
ret = verify_path(destdir);
g_free(destdir);
- if (ret < 0)
+ if (ret < 0) {
+ g_free(destination);
return ret;
+ }
source = g_build_filename(ftp->folder, name, NULL);
int err = -errno;
DBG("fopen(): %d, %s", -err, strerror(-err));
g_free(path);
+ g_free(mld);
return -EBADR;
}
}