pkarashchenko commented on code in PR #11039:
URL: https://github.com/apache/nuttx/pull/11039#discussion_r1371748529


##########
fs/vfs/fs_rename.c:
##########
@@ -371,8 +363,19 @@ static int mountptrename(FAR const char *oldpath, FAR 
struct inode *oldinode,
                 }
               else
                 {
+                  /* Save subdir to free memory may be allocated in
+                   * previous loop.
+                   */
+
+                  FAR void *tmp = subdir;
+
                   ret = asprintf(&subdir, "%s/%s", newrelpath,
                                  subdirname);
+                  if (tmp != NULL)
+                    {
+                      kmm_free(tmp);

Review Comment:
   ```suggestion
                         lib_free(tmp);
   ```



-- 
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