fix deref before null check
This commit is contained in:
parent
1174413115
commit
e3b4e6b227
|
@ -81,9 +81,10 @@ SWITCH_DECLARE(switch_status_t) switch_curl_process_form_post_params(switch_even
|
|||
|
||||
if (!strncasecmp(hp->name, "attach_file:", 12)) {
|
||||
char *pname = strdup(hp->name + 12);
|
||||
char *fname = strchr(pname, ':');
|
||||
|
||||
if (fname && pname) {
|
||||
if (pname) {
|
||||
char *fname = strchr(pname, ':');
|
||||
if (fname) {
|
||||
*fname++ = '\0';
|
||||
|
||||
curl_formadd(&formpost,
|
||||
|
@ -93,9 +94,8 @@ SWITCH_DECLARE(switch_status_t) switch_curl_process_form_post_params(switch_even
|
|||
CURLFORM_FILE, hp->value,
|
||||
CURLFORM_END);
|
||||
}
|
||||
|
||||
free(pname);
|
||||
|
||||
}
|
||||
} else {
|
||||
curl_formadd(&formpost,
|
||||
&lastptr,
|
||||
|
|
Loading…
Reference in New Issue