Skip to content

Commit a710f26

Browse files
committed
fix: add missing zend_string_release calls to prevent memory leaks
1 parent 00d09d7 commit a710f26

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

brotli.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,7 @@ static zend_string *php_brotli_output_handler_load_dict(php_brotli_context *ctx)
446446
"request(%s) != actual(%s)",
447447
Z_STRVAL_P(available), ZSTR_VAL(b64));
448448
BROTLI_G(compression_coding) &= ~PHP_BROTLI_ENCODING_DCB;
449+
zend_string_release(dict);
449450
dict = NULL;
450451
}
451452
zend_string_free(b64);
@@ -454,6 +455,7 @@ static zend_string *php_brotli_output_handler_load_dict(php_brotli_context *ctx)
454455
php_error_docref(NULL, E_WARNING,
455456
"brotli: not found available-dictionary");
456457
BROTLI_G(compression_coding) &= ~PHP_BROTLI_ENCODING_DCB;
458+
zend_string_release(dict);
457459
dict = NULL;
458460
}
459461
}

0 commit comments

Comments
 (0)