]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
WPS UDF: Fix fd leak on error path
authorJouni Malinen <j@w1.fi>
Sat, 7 Jul 2012 10:00:00 +0000 (13:00 +0300)
committerJouni Malinen <j@w1.fi>
Sat, 7 Jul 2012 10:00:00 +0000 (13:00 +0300)
Signed-hostap: Jouni Malinen <j@w1.fi>

src/wps/wps_ufd.c

index 3a8bd51b48d706e2d20c8b1b86c26e59594c9ef2..f83bdf471c74a6a4ef8fad92026f530b65135766 100644 (file)
@@ -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;
 }