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:
Bastien Nocera 2018-12-12 15:37:27 +01:00
parent 0ddd11f81b
commit 21bac43015

View file

@ -391,6 +391,7 @@ API_EXPORTED int fp_print_data_save(struct fp_print_data *data,
r = g_mkdir_with_parents(dirpath, DIR_PERMS);
if (r < 0) {
fp_err("couldn't create storage directory");
free(buf);
g_free(path);
g_free(dirpath);
return r;