|
From: | Philippe Mathieu-Daudé |
Subject: | Re: [PATCH] 9p: local: fix memory leak |
Date: | Mon, 30 Dec 2019 09:35:11 +0100 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 |
Please describe the memory leak, and if possible how you noticed it. Indeed the previous 2 calls to g_path_get_dirname() aren't free'd. On 12/30/19 3:23 AM, Yan Wang wrote:
Signed-off-by: Yan Wang <address@hidden> --- hw/9pfs/9p-local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index ca641390fb..d0592c3b45 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -947,7 +947,7 @@ static int local_link(FsContext *ctx, V9fsPath *oldpath, if (ctx->export_flags & V9FS_SM_MAPPED_FILE && local_is_mapped_file_metadata(ctx, name)) { errno = EINVAL; - return -1; + goto out;
As the rest of this function... OK.With some love this function could get clever by only allocating variables it will use.
With better commit description: Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
}odirfd = local_opendir_nofollow(ctx, odirpath);
[Prev in Thread] | Current Thread | [Next in Thread] |