libceph: fix a use after free issue in osdmap_set_max_osd
authorLi RongQing <roy.qing.li@gmail.com>
Sun, 7 Sep 2014 10:10:51 +0000 (18:10 +0800)
committerIlya Dryomov <idryomov@redhat.com>
Tue, 14 Oct 2014 17:03:21 +0000 (21:03 +0400)
If the state variable is krealloced successfully, map->osd_state will be
freed, once following two reallocation failed, and exit the function
without resetting map->osd_state, map->osd_state become a wild pointer.

fix it by resetting them after krealloc successfully.

Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: Ilya Dryomov <ilya.dryomov@inktank.com>

No differences found