v2 [patch 3/6] libcgroup: Fix up memory leak in cgroup_basename
v2 [patch 3/6] libcgroup: Fix up memory leak in cgroup_basename

We were not freeing up tmp_string if the strdup for basename failed.

Since we anyway need to free up tmp_string and return NULL if the
strdup failed, we don't really care about testing the return value
of the strdup, and therefore this check is not needed. Remove this
check then.

Thanks to Steve Grubb's review at
http://article.gmane.org/gmane.comp.lib.libcg.devel/2485

Reported-by: Steve Grubb <17a7c7c605e476cc91b20e110a29a35a2402f1f4@redhat.com>
Signed-off-by: Dhaval Giani <f48451d72a1ad74c777093928b661ad7099a85df@gmail.com>
Acked-By: Jan Safranek <a7f4b96ffdd515ecef00f117294da18555749b0b@redhat.com>

rafalmiel/libcg,jrfastab/Linux-cgdcbxd,rafalmiel/libcg,rafalmiel/libcg,jrfastab/Linux-cgdcbxd,jrfastab/Linux-cgdcbxd,rafalmiel/libcg,jrfastab/Linux-cgdcbxd