Skip to content

Commit 16a3d2f

Browse files
committed
Fix trackingFree()
Do not add memory back to the tracker, if the provider does not support the free() operation. Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 08ce30c commit 16a3d2f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/provider/provider_tracking.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,12 @@ static umf_result_t trackingFree(void *hProvider, void *ptr, size_t size) {
382382
ret = umfMemoryProviderFree(p->hUpstream, ptr, size);
383383
if (ret != UMF_RESULT_SUCCESS) {
384384
LOG_ERR("upstream provider failed to free the memory");
385+
// Do not add memory back to the tracker,
386+
// if the provider does not support the free() op.
387+
if (ret == UMF_RESULT_ERROR_NOT_SUPPORTED) {
388+
return ret_remove;
389+
}
390+
385391
// Do not add memory back to the tracker,
386392
// if it had not been removed.
387393
if (ret_remove != UMF_RESULT_SUCCESS) {

0 commit comments

Comments
 (0)