提交 b0aee351 编写于 作者: J Jesper Juhl 提交者: Sage Weil

ceph: Always free allocated memory in osdmap_decode()

Always free memory allocated to 'pi' in
net/ceph/osdmap.c::osdmap_decode().
Signed-off-by: NJesper Juhl <jj@chaosbits.net>
Signed-off-by: NSage Weil <sage@newdream.net>
上级 582c86e6
...@@ -605,8 +605,10 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end) ...@@ -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);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册