From: Jouni Malinen Date: Sat, 7 Jul 2012 10:00:00 +0000 (+0300) Subject: WPS UDF: Fix fd leak on error path X-Git-Tag: hostap_2_0~538 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19991e5fb29a7f0701024e4e7ddd03b7c7b59619;p=thirdparty%2Fhostap.git WPS UDF: Fix fd leak on error path Signed-hostap: Jouni Malinen --- diff --git a/src/wps/wps_ufd.c b/src/wps/wps_ufd.c index 3a8bd51b4..f83bdf471 100644 --- a/src/wps/wps_ufd.c +++ b/src/wps/wps_ufd.c @@ -159,8 +159,10 @@ static void * init_ufd(struct wps_context *wps, } data = os_zalloc(sizeof(*data)); - if (data == NULL) + if (data == NULL) { + close(ufd_fd); return NULL; + } data->ufd_fd = ufd_fd; return data; }