You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
usbip/userspace/libsrc/names.c: memory leak
revised patch p is freed if NULL. p is leaked if second calloc fails. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
54de9af9f0
commit
2a7470d9ff
@@ -169,15 +169,15 @@ static void *my_malloc(size_t size)
|
||||
struct pool *p;
|
||||
|
||||
p = calloc(1, sizeof(struct pool));
|
||||
if (!p) {
|
||||
if (!p)
|
||||
return NULL;
|
||||
|
||||
p->mem = calloc(1, size);
|
||||
if (!p->mem) {
|
||||
free(p);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
p->mem = calloc(1, size);
|
||||
if (!p->mem)
|
||||
return NULL;
|
||||
|
||||
p->next = pool_head;
|
||||
pool_head = p;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user