Skip to content

Commit

Permalink
ceph: Always free allocated memory in osdmap_decode()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jesper Juhl authored and Sage Weil committed Jan 12, 2011
1 parent 582c86e commit b0aee35
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ceph/osdmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,8 +605,10 @@ struct ceph_osdmap *osdmap_decode(void **p, void *end)
goto bad;
}
err = __decode_pool(p, end, pi);
if (err < 0)
if (err < 0) {
kfree(pi);
goto bad;
}
__insert_pg_pool(&map->pg_pools, pi);
}

Expand Down

0 comments on commit b0aee35

Please sign in to comment.