From 862fb68b0a1e60449ac6d977727c7e2b4f069c99 Mon Sep 17 00:00:00 2001 From: José Bollo Date: Thu, 23 Jan 2020 18:09:51 +0100 Subject: Fix globset compilation warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/globset.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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 * -- cgit 1.2.3-korg