WPS: Clean up next_advertisement() error path
No need to have a common failure handler if it is used from only a single location and that lcoation does not even need the memory freeing step. Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
b8e20236c1
commit
ccbd0518f6
1 changed files with 1 additions and 5 deletions
|
@ -139,7 +139,7 @@ next_advertisement(struct upnp_wps_device_sm *sm,
|
||||||
uuid_bin2str(iface->wps->uuid, uuid_string, sizeof(uuid_string));
|
uuid_bin2str(iface->wps->uuid, uuid_string, sizeof(uuid_string));
|
||||||
msg = wpabuf_alloc(800); /* more than big enough */
|
msg = wpabuf_alloc(800); /* more than big enough */
|
||||||
if (msg == NULL)
|
if (msg == NULL)
|
||||||
goto fail;
|
return NULL;
|
||||||
switch (a->type) {
|
switch (a->type) {
|
||||||
case ADVERTISE_UP:
|
case ADVERTISE_UP:
|
||||||
case ADVERTISE_DOWN:
|
case ADVERTISE_DOWN:
|
||||||
|
@ -213,10 +213,6 @@ next_advertisement(struct upnp_wps_device_sm *sm,
|
||||||
*islast = 1;
|
*islast = 1;
|
||||||
|
|
||||||
return msg;
|
return msg;
|
||||||
|
|
||||||
fail:
|
|
||||||
wpabuf_free(msg);
|
|
||||||
return NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue