fix: memory leak

This commit is contained in:
2025-09-07 18:17:01 -04:00
parent 530f5a54c8
commit 203d7fee48

3
XD.c
View File

@@ -101,7 +101,8 @@ char
return NULL;
}
if (strncmp(fstr, "gitdir: ", strlen("gitdir: ")) == 0) {
return realpath(strndup(fstr + strlen("gitdir: "), strlen(fstr + strlen("gitdir: ")) - 1), NULL);
fstr[strlen(fstr) - 1] = '\0';
return realpath(fstr + strlen("gitdir: "), NULL);
}
}
}