Skip to content

Commit

Permalink
Free CSTP option structure before error return if malloc fails
Browse files Browse the repository at this point in the history
Spotted by Coverity.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 26, 2012
1 parent bda1490 commit 7e952ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cstp.c
Expand Up @@ -302,6 +302,9 @@ static int start_cstp_connection(struct openconnect_info *vpninfo)

if (!new_option->option || !new_option->value) {
vpn_progress(vpninfo, PRG_ERR, _("No memory for options\n"));
free(new_option->option);
free(new_option->value);
free(new_option);
return -ENOMEM;
}

Expand Down

0 comments on commit 7e952ad

Please sign in to comment.