lkml.org 
[lkml]   [2020]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] nbd: Fix memory leak in nbd_add_socket
On Mon, Jun 29, 2020 at 09:23:49AM +0800, Zheng Bin wrote:
> When adding first socket to nbd, if nsock's allocation failed, the data
> structure member "config->socks" was reallocated, but the data structure
> member "config->num_connections" was not updated. A memory leak will occur
> then because the function "nbd_config_put" will free "config->socks" only
> when "config->num_connections" is not zero.
>
> Fixes: 03bf73c315ed ("nbd: prevent memory leak")
> Reported-by: syzbot+934037347002901b8d2a@syzkaller.appspotmail.com
> Signed-off-by: Zheng Bin <zhengbin13@huawei.com>
> ---

Reviewed-by: Eric Biggers <ebiggers@google.com>

\
 
 \ /
  Last update: 2020-07-08 22:33    [W:0.039 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site