Ver código fonte

[PAL] Fix the missing of closing the cached_file

cached_file is a PAL_HANDLE, which in the case of out will be released by _DkObjectClose(cached_file).
In the normal case, before returning &obj->map, this resource allocated within the function should
also be released to prevent it leaking out side of the function scope.

Signed-off-by: Gary <gang1.wang@intel.com>
Gary 7 anos atrás
pai
commit
3aff80d9d6
1 arquivos alterados com 1 adições e 0 exclusões
  1. 1 0
      Pal/src/db_rtld.c

+ 1 - 0
Pal/src/db_rtld.c

@@ -801,6 +801,7 @@ map_next:
     }
 
     obj->map.l_name = obj->map_name;
+    _DkObjectClose(cached_file);
     return &obj->map;
 
 out_more_mapped: