Skip to content

Commit

Permalink
Merge pull request #89 from martinprikryl/patch-1
Browse files Browse the repository at this point in the history
Memory leak
  • Loading branch information
bji authored Dec 3, 2018
2 parents 23a95ae + f7c1c48 commit 111dc30
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -833,7 +833,8 @@ static void sort_query_string(const char *queryString, char *result,

// Where did strdup go?!??
int queryStringLen = strlen(queryString);
char *tok = (char *) malloc(queryStringLen + 1);
char *buf = (char *) malloc(queryStringLen + 1);
char *tok = buf;
strcpy(tok, queryString);
const char *token = NULL;
char *save = NULL;
Expand Down Expand Up @@ -866,7 +867,7 @@ static void sort_query_string(const char *queryString, char *result,
}
#undef append

free(tok);
free(buf);
}


Expand Down

0 comments on commit 111dc30

Please sign in to comment.