Due to conditional free, the defect was occured.
Change the code to free properly.
If memory is alloced, it will be freed at the end of 'if'
setupConfig->systemData->proxy = (sa_proxy_s *) malloc(sizeof(sa_proxy_s));
if (setupConfig->systemData->proxy != NULL) {
memcpy(setupConfig->systemData->proxy->httpProxyHost, httpProxyHost, MIN(strlen(httpProxyHost), sizeof(setupConfig->systemData->proxy->httpProxyHost) - 1));
- free(httpProxyHost);
- httpProxyHost = NULL;
-
//httpProxyPort
setupConfig->systemData->proxy->httpProxyPort = json_get_int_from_obj(inputObj, SA_CONFIG_NETWORKDATA_HTTPPROXYPORT);
ret = -1;
_D("malloc fail setupConfig->systemData");
}
+
+ free(httpProxyHost);
+ httpProxyHost = NULL;
}
return ret;