From: José Bollo Date: Thu, 23 Jan 2020 17:09:51 +0000 (+0100) Subject: Fix globset compilation warning X-Git-Tag: 8.99.5^0 X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?p=src%2Fapp-framework-binder.git;a=commitdiff_plain;h=862fb68b0a1e60449ac6d977727c7e2b4f069c99 Fix globset compilation warning The case of returning NULL is not tested in `globset_add`. It is safe because `grow` is called first and then `search` never returns a NULL pointer. Bug-AGL: SPEC-3134 Signed-off-by: José Bollo Change-Id: I21e8ba3a6c8202a920c6784f4d61376450b9a063 --- diff --git a/src/globset.c b/src/globset.c index 124ff246..5ffdfa20 100644 --- a/src/globset.c +++ b/src/globset.c @@ -227,21 +227,16 @@ static struct pathndl *search( pph = &set->globs; else if (set->exacts) pph = &set->exacts[hash & set->gmask]; - else + else { + *pprev = NULL; return NULL; + } while ((ph = *pph) && strcmp(normal, ph->handler.pattern)) pph = &ph->next; *pprev = pph; return ph; } - - - - - - - /** * Allocates a new set of handlers *