hhvm
hhvm copied to clipboard
Memory Leak?
Hi all, This is Qianxin CodeSafe Team, we found a suspicious issue, at https://github.com/facebook/hhvm/blob/a3a83d96bb0cad09138a746c65ba0d5d84f77bf7/hphp/runtime/base/preg.cpp#L659 subpat_names is the memory allocated by calloc,at https://github.com/facebook/hhvm/blob/a3a83d96bb0cad09138a746c65ba0d5d84f77bf7/hphp/runtime/base/preg.cpp#L655 but we don't see the code to free this memory. If you do not call free(subpat_names) after using subpat_names, you will indeed cause a memory leak.