commit cbae186176b82efbf747a1486addb8b52c664651 from: Omar Polo date: Fri Jul 26 08:49:18 2024 UTC gotwebd: avoid unnecessary strdup() It's fine to leave the owner set to NULL in case there is none. The template {{..}} construct accepts NULLs (rendering an empty string), and repo_dir->owner is only passed to that or to free(). commit - bdd334cea6ff98524f22ce5037ba46887398725a commit + cbae186176b82efbf747a1486addb8b52c664651 blob - 4e77f9bc4e3f7fbc28bdd7acab9f92f2309e4fd3 blob + 697dd605540a5b24fafb364efc2c1a3926bd22c8 --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -116,11 +116,8 @@ got_get_repo_owner(char **owner, struct request *c) *owner = strdup(gitconfig_owner); if (*owner == NULL) return got_error_from_errno("strdup"); - } else { - *owner = strdup(""); - if (*owner == NULL) - return got_error_from_errno("strdup"); } + return NULL; }