Skip to content

Commit fefc6ad

Browse files
authored
Merge pull request #2381 from hxy7yx/v2.11-fix
[v2.11]fix(ptr): memory leak
2 parents e9fd98a + 0dd3c9c commit fefc6ad

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/adapter/driver/cache.c

+7
Original file line numberDiff line numberDiff line change
@@ -726,6 +726,13 @@ void neu_driver_cache_update_change(neu_driver_cache_t *cache,
726726
}
727727
}
728728

729+
if (elem->value.type == NEU_TYPE_PTR) {
730+
if (elem->value.value.ptr.ptr != NULL) {
731+
free(elem->value.value.ptr.ptr);
732+
elem->value.value.ptr.ptr = NULL;
733+
}
734+
}
735+
729736
if (elem->value.type == NEU_TYPE_ARRAY_STRING) {
730737
for (int i = 0; i < elem->value.value.strs.length; i++) {
731738
free(elem->value.value.strs.strs[i]);

0 commit comments

Comments
 (0)