mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
kbx: Close file handle when return.
* kbx/keybox-dump.c (_keybox_dump_find_dups): Close FP on the error paths. -- GnuPG-bug-id: 6495 Signed-off-by: zhangguangzhi <zhangguangzhi3@huawei.com>
This commit is contained in:
parent
be77c05532
commit
28a4d0d4f5
@ -810,6 +810,8 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp)
|
|||||||
gpg_error_t tmperr = gpg_error_from_syserror ();
|
gpg_error_t tmperr = gpg_error_from_syserror ();
|
||||||
fprintf (outfp, "error allocating array for '%s': %s\n",
|
fprintf (outfp, "error allocating array for '%s': %s\n",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
|
if (fp != es_stdin)
|
||||||
|
es_fclose (fp);
|
||||||
return tmperr;
|
return tmperr;
|
||||||
}
|
}
|
||||||
dupitems_count = 0;
|
dupitems_count = 0;
|
||||||
@ -834,6 +836,8 @@ _keybox_dump_find_dups (const char *filename, int print_them, FILE *outfp)
|
|||||||
fprintf (outfp, "error reallocating array for '%s': %s\n",
|
fprintf (outfp, "error reallocating array for '%s': %s\n",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
free (dupitems);
|
free (dupitems);
|
||||||
|
if (fp != es_stdin)
|
||||||
|
es_fclose (fp);
|
||||||
return tmperr;
|
return tmperr;
|
||||||
}
|
}
|
||||||
dupitems = tmp;
|
dupitems = tmp;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user