Fixed some allocation problems.
This commit is contained in:
parent
abb607c905
commit
8b8a2844bd
1 changed files with 4 additions and 3 deletions
|
@ -366,16 +366,17 @@ struct HttpRequest* api_build_http_request(struct s_request* req) {
|
||||||
*value++ = '\0';
|
*value++ = '\0';
|
||||||
}
|
}
|
||||||
if (value && (strcmp(name, "arg")==0)) {
|
if (value && (strcmp(name, "arg")==0)) {
|
||||||
libp2p_utils_vector_add(request->arguments, value);
|
libp2p_utils_vector_add(request->arguments, strdup(value));
|
||||||
} else {
|
} else {
|
||||||
struct HttpParam *hp = ipfs_core_http_param_new();
|
struct HttpParam *hp = ipfs_core_http_param_new();
|
||||||
if (hp) {
|
if (hp) {
|
||||||
hp->name = name;
|
hp->name = strdup(name);
|
||||||
hp->value = value; // maybe null ?
|
hp->value = strdup(value); // maybe null ?
|
||||||
libp2p_utils_vector_add(request->params, hp);
|
libp2p_utils_vector_add(request->params, hp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(segs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue