1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Plug resources leak

CID:		1125813
CID:		1125807
CID:		1125808
MFC after:	1 week
This commit is contained in:
Baptiste Daroussin 2015-02-04 00:10:57 +00:00
parent 3ccccdc17d
commit 92947daacf
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=278172

View File

@ -371,8 +371,11 @@ load_fingerprints(const char *path, int *count)
return (NULL);
STAILQ_INIT(fingerprints);
if ((d = opendir(path)) == NULL)
if ((d = opendir(path)) == NULL) {
free(fingerprints);
return (NULL);
}
while ((ent = readdir(d))) {
if (strcmp(ent->d_name, ".") == 0 ||
@ -799,8 +802,11 @@ bootstrap_pkg(bool force)
close(fd_sig);
unlink(tmpsig);
}
close(fd_pkg);
unlink(tmppkg);
if (fd_pkg != -1) {
close(fd_pkg);
unlink(tmppkg);
}
return (ret);
}
@ -849,7 +855,7 @@ bootstrap_pkg_local(const char *pkgpath, bool force)
if (config_string(SIGNATURE_TYPE, &signature_type) != 0) {
warnx("Error looking up SIGNATURE_TYPE");
return (-1);
goto cleanup;
}
if (signature_type != NULL &&
strcasecmp(signature_type, "FINGERPRINTS") == 0) {