Skip to content

Commit

Permalink
Free cert after comparing it with sslkey.
Browse files Browse the repository at this point in the history
There wasn't a use-after-free here, but it *looked* like it. Swap them anyway.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Mar 17, 2011
1 parent 11d48fa commit ea0c4b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library.c
Expand Up @@ -72,9 +72,9 @@ void openconnect_vpninfo_free (struct openconnect_info *vpninfo)
the library API we do take ownership of the strings we're given,
and thus we have to free them too. */
free((void *)vpninfo->cafile);
free((void *)vpninfo->cert);
if (vpninfo->cert != vpninfo->sslkey)
free((void *)vpninfo->sslkey);
free((void *)vpninfo->cert);
/* No need to free deflate streams; they weren't initialised */
free(vpninfo);
}
Expand Down

0 comments on commit ea0c4b5

Please sign in to comment.