Send connman mailing list submissions to
        [email protected]

To subscribe or unsubscribe via the World Wide Web, visit
        https://lists.01.org/mailman/listinfo/connman
or, via email, send a message with subject or body 'help' to
        [email protected]

You can reach the person managing the list at
        [email protected]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of connman digest..."


Today's Topics:

   1. [PATCHv2] iptables-unit: Fixed dereferencing null pointer in
      assert_rule() (Nishant Chaprana)


----------------------------------------------------------------------

Message: 1
Date: Tue, 15 Mar 2016 18:26:46 +0530
From: Nishant Chaprana <[email protected]>
To: [email protected]
Cc: [email protected]
Subject: [PATCHv2] iptables-unit: Fixed dereferencing null pointer in
        assert_rule()
Message-ID: <[email protected]>

---
 tools/iptables-unit.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tools/iptables-unit.c b/tools/iptables-unit.c
index 9c09867..301ce6e 100644
--- a/tools/iptables-unit.c
+++ b/tools/iptables-unit.c
@@ -33,6 +33,7 @@ static bool assert_rule(const char *table_name, const char 
*rule)
        char *cmd, *output, **lines;
        GError **error = NULL;
        int i;
+       bool ret = true;
 
        cmd = g_strdup_printf(IPTABLES_SAVE " -t %s", table_name);
        g_spawn_command_line_sync(cmd, &output, NULL, NULL, error);
@@ -46,12 +47,12 @@ static bool assert_rule(const char *table_name, const char 
*rule)
                if (g_strcmp0(lines[i], rule) == 0)
                        break;
        }
-       g_strfreev(lines);
 
        if (!lines[i])
-               return false;
+               ret = false;
 
-       return true;
+       g_strfreev(lines);
+       return ret;
 }
 
 static void assert_rule_exists(const char *table_name, const char *rule)
-- 
1.9.1



------------------------------

Subject: Digest Footer

_______________________________________________
connman mailing list
[email protected]
https://lists.01.org/mailman/listinfo/connman


------------------------------

End of connman Digest, Vol 5, Issue 22
**************************************

Reply via email to