mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-21 18:50:50 +01:00
mac_veriexec_parser: Fix open_file error handling
NDFREE_PNBUF should be called after checking the return value of vn_open(), and should only be called once. Reviewed by: imp, zlei, Kornel Dulęba <mindal@semihalf.com>, Elliott Mitchell Pull Request: https://github.com/freebsd/freebsd-src/pull/1338
This commit is contained in:
parent
674b96f58b
commit
6e45b50342
@ -241,9 +241,9 @@ open_file(const char *path, struct nameidata *nid)
|
|||||||
|
|
||||||
NDINIT(nid, LOOKUP, 0, UIO_SYSSPACE, path);
|
NDINIT(nid, LOOKUP, 0, UIO_SYSSPACE, path);
|
||||||
rc = vn_open(nid, &flags, 0, NULL);
|
rc = vn_open(nid, &flags, 0, NULL);
|
||||||
NDFREE_PNBUF(nid);
|
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
return (rc);
|
return (rc);
|
||||||
|
NDFREE_PNBUF(nid);
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
@ -346,7 +346,6 @@ parse_entry(char *entry, char *prefix)
|
|||||||
}
|
}
|
||||||
|
|
||||||
rc = open_file(path, &nid);
|
rc = open_file(path, &nid);
|
||||||
NDFREE_PNBUF(&nid);
|
|
||||||
if (rc != 0)
|
if (rc != 0)
|
||||||
return (rc);
|
return (rc);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user