Skip to content

Commit 30ee2b9

Browse files
committed
Fix #224: Segfault while using Ds\Set
The string may be refcounted or interned, so freeing is not valid, it should be releasing the string. Also switch to the _func variant as I first believed that we could use the zval_get_tmp_string() function but that would be pointless here as IS_STRING is already handled.
1 parent 4a62484 commit 30ee2b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,9 @@ void smart_str_appendz(smart_str *buffer, zval *value)
157157
return;
158158
}
159159

160-
zend_string *str = zval_get_string(value);
160+
zend_string *str = zval_get_string_func(value);
161161
smart_str_append(buffer, str);
162-
zend_string_free(str);
162+
zend_string_release_ex(str, false);
163163
}
164164

165165
zend_string *ds_join_zval_buffer(

0 commit comments

Comments
 (0)