You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "pkarashchenko (via GitHub)" <gi...@apache.org> on 2023/09/04 11:36:51 UTC

[GitHub] [nuttx-apps] pkarashchenko commented on a diff in pull request #2027: Fixed the error that when the driver scan result is empty, iwe_stream…

pkarashchenko commented on code in PR #2027:
URL: https://github.com/apache/nuttx-apps/pull/2027#discussion_r1314833346


##########
wireless/wapi/src/wireless.c:
##########
@@ -1337,16 +1339,16 @@ int wapi_scan_coll(int sock, FAR const char *ifname,
       FAR char *tmp;
 
       buflen *= 2;
-      tmp = realloc(buf, buflen);
+      tmp = malloc(buflen);
+      free(buf);

Review Comment:
   Do we need to free only if allocation succeededs or unconditionally?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org