commit 7eb2c8df6b04721c408a742bf87372a174790fd4 from: Stefan Sperling date: Fri Feb 14 11:13:16 2020 UTC no need to dup refname in gw_output_repo_heads() commit - eb4f3ad3e4ca2f06e2b92793d80b627965593f82 commit + 7eb2c8df6b04721c408a742bf87372a174790fd4 blob - 81e2a19eda1a789f27f996797c0ca05c94ba29fa blob + 16e152bb4170acd301b8b2661856923eb481b208 --- gotweb/gotweb.c +++ gotweb/gotweb.c @@ -4001,21 +4001,19 @@ gw_output_repo_heads(struct gw_trans *gw_trans) goto done; SIMPLEQ_FOREACH(re, &refs, entry) { - char *refname; + const char *refname; if (got_ref_is_symbolic(re->ref)) continue; - refname = strdup(got_ref_get_name(re->ref)); + refname = got_ref_get_name(re->ref); if (refname == NULL) { error = got_error_from_errno("got_ref_to_str"); goto done; } - if (strncmp(refname, "refs/heads/", 11) != 0) { - free(refname); + if (strncmp(refname, "refs/heads/", 11) != 0) continue; - } error = gw_get_repo_age(&age, gw_trans, gw_trans->gw_dir->path, refname, TM_DIFF);