You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//malloc the ns memery
ns = malloc(alloc);
if(!ns)
return NULL;
//malloc ok
length = alloc-1;
while(length--) {
unsigned char in = string; / we need to treat the characters unsigned */
if(Curl_isunreserved(in))
/* just copy this */
ns[strindex++] = in;
else {
/* encode it */
newlen += 2; /* the size grows with two, since this'll become a %XX */
if(newlen > alloc) {
alloc *= 2;
testing_ptr = Curl_saferealloc(ns, alloc);
if(!testing_ptr)
return NULL;
// Here will cause the memery leak.
.....
}
The text was updated successfully, but these errors were encountered:
edrav2/eprj/curl/lib/escape.c
char *curl_easy_escape(struct Curl_easy *data, const char *string,
int inlength)
{
....
alloc = (inlength?(size_t)inlength:strlen(string)) + 1;
newlen = alloc;
//malloc the ns memery
ns = malloc(alloc);
if(!ns)
return NULL;
//malloc ok
length = alloc-1;
while(length--) {
unsigned char in = string; / we need to treat the characters unsigned */
}
The text was updated successfully, but these errors were encountered: