Skip to content

Commit 344b607

Browse files
committed
PHP-1291: memleak when serializing nested objects/array
1 parent a7cbc49 commit 344b607

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/bson.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,7 @@ bool php_phongo_bson_visit_document(const bson_iter_t *iter __attribute__((unuse
525525
return true;
526526
}
527527
}
528+
Z_SET_REFCOUNT_P(zchild, 1);
528529
}
529530

530531
return false;
@@ -551,6 +552,7 @@ bool php_phongo_bson_visit_array(const bson_iter_t *iter __attribute__((unused))
551552
return true;
552553
}
553554
}
555+
Z_SET_REFCOUNT_P(zchild, 1);
554556
}
555557

556558
return false;

0 commit comments

Comments
 (0)