diff options
author | Joel Stanley <joel@jms.id.au> | 2018-03-06 14:32:20 +1030 |
---|---|---|
committer | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-03-07 16:24:31 +1100 |
commit | 47d0601affe80d7f98a2053749f5e1d479f902f4 (patch) | |
tree | 6c464dc65e6284cfbddddad904fddda5ef722f26 | |
parent | 2c97f136757b5428bb68f91cfa723990dcd985c8 (diff) | |
download | talos-petitboot-47d0601affe80d7f98a2053749f5e1d479f902f4.tar.gz talos-petitboot-47d0601affe80d7f98a2053749f5e1d479f902f4.zip |
discover: pxe: Avoid dereferencing null pointer
When result is null, we may end up in the error handling path where we
try to dereference null to call cleanup_local. This adds a check for
result.
Found with scan-build.
Signed-off-by: Joel Stanley <joel@jms.id.au>
Reviewed-by: Cyril Bur <cyrilbur@gmail.com>
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
[Fixed up commit message typo]
-rw-r--r-- | discover/pxe-parser.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/discover/pxe-parser.c b/discover/pxe-parser.c index 5c80b13..d2ebaab 100644 --- a/discover/pxe-parser.c +++ b/discover/pxe-parser.c @@ -324,7 +324,7 @@ static void pxe_conf_parse_cb(struct load_url_result *result, void *data) talloc_free(buf); out_clean: - if (result->cleanup_local) + if (result && result->cleanup_local) unlink(result->local); talloc_free(conf); } |