ceph: Always free allocated memory in osdmap_decode()
Always free memory allocated to 'pi' in net/ceph/osdmap.c::osdmap_decode(). Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
582c86e690
commit
b0aee3516d
@ -605,8 +605,10 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end)
|
|||||||
goto bad;
|
goto bad;
|
||||||
}
|
}
|
||||||
err = __decode_pool(p, end, pi);
|
err = __decode_pool(p, end, pi);
|
||||||
if (err < 0)
|
if (err < 0) {
|
||||||
|
kfree(pi);
|
||||||
goto bad;
|
goto bad;
|
||||||
|
}
|
||||||
__insert_pg_pool(&map->pg_pools, pi);
|
__insert_pg_pool(&map->pg_pools, pi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user