Commit Diff
- Commit:
cbae186176b82efbf747a1486addb8b52c664651
- From:
- Omar Polo <op@omarpolo.com>
- Date:
- Message:
- 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().
- Actions:
- Patch | Tree
--- 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; }