commit 025eb8a5503ebea0b3dffaf887ef0fd8aa5e1d23 from: Stefan Sperling date: Tue Jan 08 21:26:44 2019 UTC avoid unnecessary strdup() in got_pathset's find_element() commit - 6b798c3c8a2a1a0b86a2e6fbbe3d3be758f9b56c commit + 025eb8a5503ebea0b3dffaf887ef0fd8aa5e1d23 blob - 828ea4b4b7a8de64669c944e61fe0a10251f64ae blob + 9b124332dccbad46104feed8d49eca8c3bcd383e --- lib/pathset.c +++ lib/pathset.c @@ -138,9 +138,9 @@ static struct got_pathset_element * find_element(struct got_pathset *set, const char *path) { struct got_pathset_element key, *entry; - key.path = strdup(path); + key.path = (char *)path; + key.data = NULL; entry = RB_FIND(got_pathset_tree, &set->entries, &key); - free(key.path); return entry; }