mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
lib: Fix memory leak on error in fp_print_data_save()
libfprint/fpi-data.c:393:3: warning: Potential leak of memory pointed to by 'buf'
fp_err("couldn't create storage directory");
^~~~~~
libfprint/fpi-log.h:75:16: note: expanded from macro 'fp_err'
#define fp_err g_warning
^~~~~~~~~
This commit is contained in:
@@ -391,6 +391,7 @@ API_EXPORTED int fp_print_data_save(struct fp_print_data *data,
|
|||||||
r = g_mkdir_with_parents(dirpath, DIR_PERMS);
|
r = g_mkdir_with_parents(dirpath, DIR_PERMS);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
fp_err("couldn't create storage directory");
|
fp_err("couldn't create storage directory");
|
||||||
|
free(buf);
|
||||||
g_free(path);
|
g_free(path);
|
||||||
g_free(dirpath);
|
g_free(dirpath);
|
||||||
return r;
|
return r;
|
||||||
|
|||||||
Reference in New Issue
Block a user