File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -371,12 +371,17 @@ PHP_FUNCTION(msg_send)
371371 php_var_serialize (& msg_var , message , & var_hash );
372372 PHP_VAR_SERIALIZE_DESTROY (var_hash );
373373
374- message_len = smart_str_get_len (& msg_var );
374+ if (UNEXPECTED (EG (exception ))) {
375+ smart_str_free (& msg_var );
376+ RETURN_FALSE ;
377+ }
378+
375379
380+ zend_string * str = smart_str_extract (& msg_var );
381+ message_len = ZSTR_LEN (str );
376382 /* NB: php_msgbuf is 1 char bigger than a long, so there is no need to
377383 * allocate the extra byte. */
378384 messagebuffer = safe_emalloc (message_len , 1 , sizeof (struct php_msgbuf ));
379- zend_string * str = smart_str_extract (& msg_var );
380385 memcpy (messagebuffer -> mtext , ZSTR_VAL (str ), message_len + 1 );
381386 zend_string_release (str );
382387 smart_str_free (& msg_var );
You can’t perform that action at this time.
0 commit comments