@@ -147,20 +147,17 @@ static int asnprintf(char **strp, size_t size, const char *fmt, ...)
char *build_id_cache__kallsyms_path(const char *sbuild_id, char *bf,
size_t size)
{
- bool is_alloc = !!bf;
bool retry_old = true;
- asnprintf(&bf, size, "%s/%s/%s/kallsyms",
- buildid_dir, DSO__NAME_KALLSYMS, sbuild_id);
+ snprintf(bf, size, "%s/%s/%s/kallsyms",
+ buildid_dir, DSO__NAME_KALLSYMS, sbuild_id);
retry:
if (!access(bf, F_OK))
return bf;
- if (is_alloc)
- free(bf);
if (retry_old) {
/* Try old style kallsyms cache */
- asnprintf(&bf, size, "%s/%s/%s",
- buildid_dir, DSO__NAME_KALLSYMS, sbuild_id);
+ snprintf(bf, size, "%s/%s/%s",
+ buildid_dir, DSO__NAME_KALLSYMS, sbuild_id);
retry_old = false;
goto retry;
}