nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Memory leak in browser


From: Rishabh Dave
Subject: [Nano-devel] Memory leak in browser
Date: Mon, 22 Feb 2016 23:42:57 +0530

Hello,

A free-statement was missing to deallocate the string returned by striponedir(), thanks to the comment in the source code before it.

https://savannah.gnu.org/bugs/?47206

Valgrind showed loss of 116 bytes instead of 32 bytes as in the comment #0 - https://savannah.gnu.org/bugs/?47206#comment0. However loss is zero now.

Which one of the following manner is better, former or latter? I kept former as latter breaks the indentation.

Manner #1 -

+               temp = striponedir(filelist[selected]);
+               prev_dir = mallocstrcpy(NULL, temp);

Manner #2 -

+               prev_dir = mallocstrcpy(NULL, (temp = striponedir(filelist[selected]));

Attachment: temp-for-allowing-free.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]