From: Jouni Malinen Date: Sat, 18 Oct 2025 15:19:51 +0000 (+0300) Subject: PASN: Clear extra_ies_len to 0 on freeing extra_ies X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=afdf372ce9df1b08ede86159facc553fd216dfc2;p=thirdparty%2Fhostap.git PASN: Clear extra_ies_len to 0 on freeing extra_ies There is no point in setting extra_ies_len to the new value in pasn_set_extra_ies() at the point when the old value is freed. This setting happens already at the appropriate place after the new value has been successfully assigned. Set extra_ies_len to 0 here so that it will have value 0 in case the allocation fails and leaves extra_ies to NULL. Signed-off-by: Jouni Malinen --- diff --git a/src/pasn/pasn_common.c b/src/pasn/pasn_common.c index e29221178..3b336715a 100644 --- a/src/pasn/pasn_common.c +++ b/src/pasn/pasn_common.c @@ -185,7 +185,7 @@ int pasn_set_extra_ies(struct pasn_data *pasn, const u8 *extra_ies, if (pasn->extra_ies) { os_free((u8 *) pasn->extra_ies); - pasn->extra_ies_len = extra_ies_len; + pasn->extra_ies_len = 0; } pasn->extra_ies = os_memdup(extra_ies, extra_ies_len);