From 1d32ea461f152c13079159b9b4f390c1fb976a4b Mon Sep 17 00:00:00 2001 From: "min7.choi" Date: Tue, 3 May 2016 11:15:53 +0900 Subject: [PATCH] Fix SVACE issue : WGID 25417 [issue] WGID 25417 [Problem] DEREF_AFTER_NULL.EX [Solution] Add null check before pointer value dereference [Verify] Latest SVACE result Change-Id: I8bf6031243034ac8598a51c1edd7e491f8f67776 Signed-off-by: min7.choi --- provider/download-provider-plugin-download-agent.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/provider/download-provider-plugin-download-agent.c b/provider/download-provider-plugin-download-agent.c index 6391fe3..953cbe0 100755 --- a/provider/download-provider-plugin-download-agent.c +++ b/provider/download-provider-plugin-download-agent.c @@ -958,8 +958,11 @@ int dp_start_agent_download(void *slot, void *request) int len = 0; int i = 0; len = req_data->request_header_count; - for (i = 0; i < len; i++) - free((void *)(req_data->request_header[i])); + if (req_data->request_header != NULL) { + for (i = 0; i < len; i++){ + free((void *)(req_data->request_header[i])); + } + } free(req_data->request_header); } free(url); -- 2.7.4