anchao commented on code in PR #10676:
URL: https://github.com/apache/nuttx/pull/10676#discussion_r1328244951


##########
libs/libc/modlib/modlib_loadhdrs.c:
##########
@@ -116,7 +116,6 @@ int modlib_loadhdrs(FAR struct mod_loadinfo_s *loadinfo)
       loadinfo->phdr = (FAR Elf_Phdr *)lib_malloc(phdrsize);
       if (!loadinfo->phdr)
         {
-          lib_free(loadinfo->shdr);

Review Comment:
   keep the free call  and assigning the pointer to null 



##########
libs/libc/modlib/modlib_loadhdrs.c:
##########
@@ -129,8 +128,6 @@ int modlib_loadhdrs(FAR struct mod_loadinfo_s *loadinfo)
       if (ret < 0)
         {
           berr("ERROR: Failed to read program header table: %d\n", ret);
-          lib_free(loadinfo->phdr);
-          lib_free(loadinfo->shdr);

Review Comment:
   keep the free call  and assigning the pointer to null 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to