qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH] qemu-nbd.c : fix memory leak


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] qemu-nbd.c : fix memory leak
Date: Fri, 2 Dec 2011 11:08:36 +0000
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, Dec 02, 2011 at 08:48:50AM +0100, Paolo Bonzini wrote:
> On 12/02/2011 08:42 AM, Stefan Weil wrote:
> >>>
> >>>-    if (sharing_fds[0] == -1)
> >>>+    if (sharing_fds[0] == -1) {
> >>>+        g_free(sharing_fds);
> >>>          return 1;
> >>>+    }
> >>>
> >>>      if (device) {
> >>>          int ret;
> >>Zhihui,
> >>
> >>Kernel should free all memory used by the process after it exits.  So
> >>there's no memory leak even without explicit free.
> >
> >That's correct. Nevertheless fixing this helps to find other more important
> >memory leaks with static or dynamic code analyzers like cppcheck or
> >valgrind.
> >
> >Reviewed-by: Stefan Weil <address@hidden>
> 
> Please hold off, I'm about to introduce large changes to qemu-nbd
> for asynchronous I/O (including getting rid of sharing_fds in favor
> of the main loop) and and I'd rather avoid gratuitous conflicts.

Okay, let's wait for Paolo's changes.

Stefan



reply via email to

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