]> git.proxmox.com Git - mirror_corosync.git/commitdiff
cfg.c: avoid useless if-before-free
authorJim Meyering <jim@meyering.net>
Mon, 18 May 2009 16:41:13 +0000 (16:41 +0000)
committerJim Meyering <jim@meyering.net>
Mon, 18 May 2009 16:41:13 +0000 (16:41 +0000)
* lib/cfg.c (corosync_cfg_ring_status_get): Avoid useless if-before-free
and change syntax to avoid triggering false-positive failure of
the "make syntax-check" sc_cast_of_argument_to_free rule.

git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2189 fd59a12c-fef9-0310-b244-a6a79926bd2f

lib/cfg.c

index 4cd0c92ff72a34db94b3abf5c3307cd5651d5a63..3965002cd66eaf62b0baa7eaaa6f803bda4f30d6 100644 (file)
--- a/lib/cfg.c
+++ b/lib/cfg.c
@@ -324,12 +324,8 @@ corosync_cfg_ring_status_get (
 
 error_free_contents:
        for (i = 0; i < res_lib_cfg_ringstatusget.interface_count; i++) {
-               if ((*(interface_names))[i]) {
-                       free ((*(interface_names))[i]);
-               }
-               if ((*(status))[i]) {
-                       free ((*(status))[i]);
-               }
+               free (*interface_names + i);
+               free (*status + i);
        }
 
        free (*status);