lib/cache_mngr.c: avoid memleak if realloc fails
lib/cache_mngr.c: avoid memleak if realloc fails

foo = realloc(foo, ...) is almost always a bug - the only exceptions
being if (a) one just exits the process in case of failure or (b) if one
has made a copy of the foo pointer before the realloc call, and takes
care to either reinstate it afterwards or free() it and make sure that
the data structure is updated to handle foo now being NULL (in this case
for example setting ->cm_nassocs to 0). (a) is not an option in
libraries, and (b) is more cumbersome than just doing it the canonical
way: use local variables for the new pointer and size, and only install
them when realloc succeeds.

tklauser/libnl,thom311/libnl,greearb/libnl-ct,thom311/libnl,tklauser/libnl,greearb/libnl-ct,greearb/libnl-ct,tklauser/libnl,thom311/libnl,tklauser/libnl