Download raw body.
patch: bail out in fetchname() if out_of_memory
savestr() is basically xstrdup() with an optional path for "plan A" where it returns NULL instead of fatal(). afaik, this is the only place where we don't check out_of_mem after savestr(). bailing out seems nicer than crashing on the next line. ok? diff /home/op/w/patch path + /home/op/w/patch commit - df4e48f5c58474cd91cf83065e253c9efdfe5d93 blob - c94a3f2beb10a18d9687941619e72776bf160a7f file + util.c --- util.c +++ util.c @@ -356,6 +356,8 @@ fetchname(const char *at, bool *exists, int strip_lead if (strnEQ(at, _PATH_DEVNULL, sizeof(_PATH_DEVNULL) - 1)) return NULL; name = fullname = t = savestr(at); + if (out_of_mem) + return NULL; tab = strchr(t, '\t') != NULL; /* Strip off up to `strip_leading' path components and NUL terminate. */
patch: bail out in fetchname() if out_of_memory