[PECL-CVS] [pecl-networking-gearman] memory-audit: address copilot issues
[email protected] (Rasmus Lerdorf) Tue, 10 Feb 2026 05:15:21 +0000
| Newsgroups | php.pecl.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Rasmus Lerdorf (rlerdorf)
Date: 2026-02-10T00:15:15-05:00
Commit: https://github.com/php/pecl-networking-gearman/commit/92f271977991a2d586631b7874f57590701898ec
Raw diff: https://github.com/php/pecl-networking-gearman/commit/92f271977991a2d586631b7874f57590701898ec.diff
address copilot issues
Changed paths:
M php_gearman_worker.c
Diff:
diff --git a/php_gearman_worker.c b/php_gearman_worker.c
index 3c04998..7695a2d 100644
--- a/php_gearman_worker.c
+++ b/php_gearman_worker.c
@@ -59,8 +59,10 @@ PHP_METHOD(GearmanWorker, __construct) {
void gearman_worker_free_obj(zend_object *object) {
gearman_worker_obj *intern = gearman_worker_fetch_object(object);
- if (!intern) {
- return;
+
+ if (intern->flags & GEARMAN_WORKER_OBJ_CREATED) {
+ gearman_worker_free(&(intern->worker));
+ intern->flags &= ~GEARMAN_WORKER_OBJ_CREATED;
}
zval_dtor(&intern->cb_list);