Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trurl: fix a few returns codes for out of memory #368

Merged
merged 1 commit into from
Sep 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions trurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1748,13 +1748,13 @@ static void normalize_part(struct option *o, CURLU *uh, CURLUPart part)
/* First URL decode the component */
char *rawptr = curl_easy_unescape(NULL, ptr, (int)ptrlen, &olen);
if(!rawptr)
errorf(o, ERROR_ITER, "out of memory");
errorf(o, ERROR_MEM, "out of memory");

/* Then URL encode it again */
uptr = curl_easy_escape(NULL, rawptr, olen);
curl_free(rawptr);
if(!uptr)
errorf(o, ERROR_ITER, "out of memory");
errorf(o, ERROR_MEM, "out of memory");

if(strcmp(ptr, uptr))
/* changed, store the updated one */
Expand Down Expand Up @@ -1882,7 +1882,7 @@ static void singleurl(struct option *o,
char *cpath;
bool path_is_modified = false;
if(curl_url_get(uh, CURLUPART_PATH, &opath, 0))
errorf(o, ERROR_ITER, "out of memory");
errorf(o, ERROR_MEM, "out of memory");

/* append path segments */
for(p = o->append_path; p; p = p->next) {
Expand Down Expand Up @@ -1917,7 +1917,7 @@ static void singleurl(struct option *o,
if(path_is_modified) {
/* set the new path */
if(curl_url_set(uh, CURLUPART_PATH, opath, 0))
errorf(o, ERROR_ITER, "out of memory");
errorf(o, ERROR_MEM, "out of memory");
}
curl_free(opath);

Expand Down