Skip to content

Commit

Permalink
trurl: fix a few returns codes for out of memory
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Sep 16, 2024
1 parent 95edef9 commit b4e5eab
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit b4e5eab

Please sign in to comment.