cap_mkdb: Fix memory leak
This is not a big deal since it only iterates once before exiting, but that's no reason to set a bad example. PR: 195128 MFC after: 1 week Reviewed by: ngie Differential Revision: https://reviews.freebsd.org/D57251
This commit is contained in:
@@ -117,6 +117,7 @@ main(int argc, char *argv[])
|
||||
|
||||
if (capdbp->close(capdbp) < 0)
|
||||
err(1, "%s", capname);
|
||||
free(capname);
|
||||
capname = NULL;
|
||||
exit(0);
|
||||
}
|
||||
@@ -151,7 +152,7 @@ db_build(char **ifiles)
|
||||
|
||||
data.data = NULL;
|
||||
key.data = NULL;
|
||||
for (reccnt = 0, bplen = 0; (st = cgetnext(&bp, ifiles)) > 0;) {
|
||||
for (reccnt = 0, bplen = 0; (st = cgetnext(&bp, ifiles)) > 0; free(bp)) {
|
||||
|
||||
/*
|
||||
* Allocate enough memory to store record, terminating
|
||||
|
||||
Reference in New Issue
Block a user