Whamcloud - gitweb
ss_create_invocation: fix potential unititalized reference in error path
authorTheodore Ts'o <tytso@mit.edu>
Tue, 3 Aug 2021 15:03:34 +0000 (11:03 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 3 Aug 2021 15:03:34 +0000 (11:03 -0400)
Fixes: eccdde1ff381 ("ss_create_invocation: fix error handling when ...")
Addresses-Coverity-Bug: 1489771
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ss/invocation.c

index bf5ea0c..7d7458a 100644 (file)
@@ -36,6 +36,7 @@ int ss_create_invocation(const char *subsystem_name, const char *version_string,
        new_table = (ss_data *) malloc(sizeof(ss_data));
        if (!new_table)
                goto out;
+       memset(new_table, 0, sizeof(ss_data));
 
        if (table == (ss_data **) NULL) {
                table = (ss_data **) malloc(2 * size);