Skip to content
This repository has been archived by the owner on Mar 12, 2019. It is now read-only.

Commit

Permalink
unleak a bit
Browse files Browse the repository at this point in the history
	closes #310
  • Loading branch information
jpmens committed Nov 21, 2018
1 parent acae8f6 commit 2795fef
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion be-http.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ static int get_string_envs(CURL *curl, const char *required_env, char *querystri
//_log(LOG_DEBUG, "escaped_key=%s", escaped_key);
//_log(LOG_DEBUG, "escaped_val=%s", escaped_envvalue);

data = (char *)malloc(strlen(escaped_key) + strlen(escaped_val) + 1);
data = (char *)malloc(strlen(escaped_key) + strlen(escaped_val) + 4);
if ( data == NULL ) {
_fatal("ENOMEM");
return (-1);
Expand All @@ -83,6 +83,8 @@ static int get_string_envs(CURL *curl, const char *required_env, char *querystri
strcat(querystring, data);
}
free(data);
curl_free(escaped_key);
curl_free(escaped_val);
}

if (escaped_key) free(escaped_key);
Expand Down

0 comments on commit 2795fef

Please sign in to comment.