mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-05-04 22:49:32 +03:00
fix free in realpath when using ASAN
This commit is contained in:
parent
6b4f3f6223
commit
8f7d1e9a41
1 changed files with 2 additions and 1 deletions
|
@ -396,7 +396,8 @@ char* mi_heap_realpath(mi_heap_t* heap, const char* fname, char* resolved_name)
|
||||||
char* rname = realpath(fname, NULL);
|
char* rname = realpath(fname, NULL);
|
||||||
if (rname == NULL) return NULL;
|
if (rname == NULL) return NULL;
|
||||||
char* result = mi_heap_strdup(heap, rname);
|
char* result = mi_heap_strdup(heap, rname);
|
||||||
free(rname); // use regular free! (which may be redirected to our free but that's ok)
|
mi_cfree(rname); // use checked free (which may be redirected to our free but that's ok)
|
||||||
|
// note: with ASAN realpath is intercepted and mi_cfree may leak the returned pointer :-(
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Reference in a new issue