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:
parent
0ddd11f81b
commit
21bac43015
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue