From e720859f57fcc36dd23a1a4fb66e5f75a0edf26c Mon Sep 17 00:00:00 2001 From: Nicolas Iooss Date: Sun, 5 Mar 2017 18:13:00 +0100 Subject: [PATCH] restorecond: add noreturn attribute to exitApp() This makes it possible for static analyzers such as clang's one to understand that strings_list_add() cannot dereference a NULL pointer in the following code: if (!newptr) exitApp("Out of Memory"); newptr->string = strdup(string); Signed-off-by: Nicolas Iooss --- restorecond/restorecond.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/restorecond/restorecond.h b/restorecond/restorecond.h index a6be584c..db7e50f7 100644 --- a/restorecond/restorecond.h +++ b/restorecond/restorecond.h @@ -33,7 +33,7 @@ extern int run_as_user; extern int start(void); extern int server(int, const char *watch_file); -extern void exitApp(const char *msg); +extern void exitApp(const char *msg) __attribute__((__noreturn__)); extern void read_config(int fd, const char *watch_file); extern int watch(int fd, const char *watch_file);