]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix wrong warning from clang 1310/head
authorVincent JARDIN <vincent.jardin@6wind.com>
Mon, 9 Oct 2017 11:07:50 +0000 (13:07 +0200)
committerVincent JARDIN <vincent.jardin@6wind.com>
Mon, 9 Oct 2017 11:07:50 +0000 (13:07 +0200)
The compiler cannot guess that rise() will not return here.
One should help.

Warning:
  Access to field 'file' results in a dereference of a null pointer
  (loaded from variable 'error')
aka error->file while error is NULL.

Signed-off-by: Vincent Jardin <vincent.jardin@6wind.com>
lib/ferr.c

index 2a039d208902670668f7c7cd3fc896c289737245..69aeb3db40f2a61108255525f79b8b81ecaf85ac 100644 (file)
@@ -74,6 +74,7 @@ static ferr_r ferr_set_va(const char *file, int line, const char *func,
                        /* we're screwed */
                        zlog_err("out of memory while allocating error info");
                        raise(SIGSEGV);
+                       abort(); /* raise() can return, but raise(SIGSEGV) shall not */
                }
 
                pthread_setspecific(errkey, error);