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 <[email protected]>
---
 src/api.c |    3 ---
 1 file changed, 3 deletions(-)

Index: libcg/src/api.c
===================================================================
--- libcg.orig/src/api.c
+++ libcg/src/api.c
@@ -272,9 +272,6 @@ static char *cgroup_basename(const char 
 
        base = strdup(basename(tmp_string));
 
-       if (!base)
-               return NULL;
-
        free(tmp_string);
 
        return base;



------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Libcg-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libcg-devel

Reply via email to