pass: parser: clear freed scenario.list in pass_put_table()
authorSeung-Woo Kim <sw0312.kim@samsung.com>
Mon, 23 Oct 2017 05:03:52 +0000 (14:03 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Mon, 20 Nov 2017 00:52:33 +0000 (09:52 +0900)
Clear freed scenario.list in pass_put_table() to remove possibility
of use-after-free.

Change-Id: I959546e12c1f811313cd65b50b7bac18b9787d6d
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
src/pass/pass-parser.c

index e42f10d99967840c52da432c38c7783754290f93..e000938146203b4abbf68cb2cafccfe2fb9c315d 100644 (file)
@@ -482,8 +482,10 @@ void pass_put_table(struct pass_policy *policy)
                policy->pass_table = NULL;
        }
 
-       if (policy->scenario.list)
+       if (policy->scenario.list) {
                free(policy->scenario.list);
+               policy->scenario.list = NULL;
+       }
 }
 
 static int pass_parse_resource_data(struct parse_result *result,