ctdb-logging: CID 1396883 Dereference null return value (NULL_RETURNS)
authorMartin Schwenke <martin@meltin.net>
Thu, 23 Feb 2017 00:31:32 +0000 (11:31 +1100)
committerMartin Schwenke <martins@samba.org>
Fri, 24 Feb 2017 06:47:09 +0000 (07:47 +0100)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12592

The fix in 08e03fa7f5fdc7f988fbbb26929e8c5727f36c2e is incomplete.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
ctdb/common/logging.c

index c8ccf26..8e547c9 100644 (file)
@@ -522,6 +522,7 @@ int logging_init(TALLOC_CTX *mem_ctx, const char *logging,
 
        name = strtok(str, ":");
        if (name == NULL) {
+               talloc_free(str);
                return EINVAL;
        }
        option = strtok(NULL, ":");