diff options
Diffstat (limited to 'utils/statd/notlist.c')
-rw-r--r-- | utils/statd/notlist.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/utils/statd/notlist.c b/utils/statd/notlist.c index 4f52b1d..98aa6e2 100644 --- a/utils/statd/notlist.c +++ b/utils/statd/notlist.c @@ -61,8 +61,12 @@ nlist_new(char *my_name, char *mon_name, int state) NL_TIMES(new) = MAX_TRIES; NL_STATE(new) = state; if (!(NL_MY_NAME(new) = xstrdup(my_name)) - || !(NL_MON_NAME(new) = xstrdup(mon_name))) + || !(NL_MON_NAME(new) = xstrdup(mon_name))) { + if (NL_MY_NAME(new)) + free(NL_MY_NAME(new)); + free(new); return NULL; + } return new; } |