Skip to content

Commit

Permalink
list delete: return if next element is null (fixes #20)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Dahl <post@lespocky.de>
  • Loading branch information
LeSpocky committed May 9, 2016
1 parent fe207a5 commit a4f2e93
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ int slist_delete(char *name, formvars **start, formvars **last)
// the value of start variable, then it works correctly
prior = *start;

if ( !(*start)->next ) return 0;

// Critical section:
// the next item is the one to be deleted???
if (!strcasecmp((*start)->next->name, name)) {
Expand Down

0 comments on commit a4f2e93

Please sign in to comment.