From 19991e5fb29a7f0701024e4e7ddd03b7c7b59619 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 7 Jul 2012 13:00:00 +0300 Subject: [PATCH] WPS UDF: Fix fd leak on error path Signed-hostap: Jouni Malinen --- src/wps/wps_ufd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; }