Skip to content

Commit

Permalink
restorecond: add noreturn attribute to exitApp()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
fishilico authored and jwcart2 committed Mar 7, 2017
1 parent 43b24f0 commit e720859
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion restorecond/restorecond.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e720859

Please sign in to comment.