Skip to content

Commit

Permalink
Check for alloc failure in cookie addition
Browse files Browse the repository at this point in the history
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Nov 6, 2009
1 parent 50e9810 commit 3af8a17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions http.c
Expand Up @@ -62,6 +62,12 @@ int http_add_cookie(struct openconnect_info *vpninfo, const char *option, const
new->next = NULL;
new->option = strdup(option);
new->value = strdup(value);
if (!new->option || !new->value) {
free(new->option);
free(new->value);
free(new);
return -ENOMEM;
}
} else {
/* Kill cookie; don't replace it */
new = NULL;
Expand Down

0 comments on commit 3af8a17

Please sign in to comment.