From: Pedro Scarapicchia Junior Date: Mon, 9 May 2011 14:10:49 +0000 (+0000) Subject: net/9p/protocol.c: Fix a memory leak X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1b0bcbcf62884959fa7214eb16c44cff445691c6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git net/9p/protocol.c: Fix a memory leak When p9pdu_readf() is called with "s" attribute, it allocates a pointer that will store a string. In p9dirent_read(), this pointer is not being released, leading to out of memory errors. This patch releases this pointer after string is copyed to dirent->d_name. Signed-off-by: Pedro Scarapicchia Junior Signed-off-by: Eric Van Hensbergen --- diff --git a/net/9p/protocol.c b/net/9p/protocol.c index b58a501cf3d1..a873277cb996 100644 --- a/net/9p/protocol.c +++ b/net/9p/protocol.c @@ -674,6 +674,7 @@ int p9dirent_read(char *buf, int len, struct p9_dirent *dirent, } strcpy(dirent->d_name, nameptr); + kfree(nameptr); out: return fake_pdu.offset;