From: Ben Pfaff Date: Wed, 28 May 2008 23:02:00 +0000 (-0700) Subject: Fix use-after-free bug. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=051ea3978c4a74fb44978b49eec6bbacee751516;p=openvswitch Fix use-after-free bug. --- diff --git a/secchan/secchan.c b/secchan/secchan.c index 6dd6302c..26621dfe 100644 --- a/secchan/secchan.c +++ b/secchan/secchan.c @@ -224,14 +224,16 @@ new_management_connection(const char *nl_name, struct vconn *new_remote) VLOG_ERR("could not connect to %s (%s)", nl_name_without_subscription, strerror(retval)); vconn_close(new_remote); + free(nl_name_without_subscription); return; } - free(nl_name_without_subscription); /* Add it to the relay list. */ r1 = rconn_new_from_vconn(nl_name_without_subscription, 1, new_local); r2 = rconn_new_from_vconn("passive", 1, new_remote); relay_create(r1, r2); + + free(nl_name_without_subscription); } static void