fix valgrind error

pull/10041/head
Brent Shaffer 3 years ago
parent c8fa2f1168
commit ecd1476f4a
  1. 8
      php/ext/google/protobuf/def.c

@ -504,13 +504,15 @@ static zend_class_entry *Descriptor_GetGeneratedClass(const upb_MessageDef *m) {
zend_string *str = zend_string_init(classname, strlen(classname), 0); zend_string *str = zend_string_init(classname, strlen(classname), 0);
zend_class_entry *ce = zend_lookup_class(str); // May autoload the class. zend_class_entry *ce = zend_lookup_class(str); // May autoload the class.
zend_string_release (str);
if (!ce) { if (!ce) {
char *classname2 = char *classname2 =
GetPhpClassname(upb_MessageDef_File(m), upb_MessageDef_FullName(m), true); GetPhpClassname(upb_MessageDef_File(m), upb_MessageDef_FullName(m), true);
str = zend_string_init(classname2, strlen(classname2), 0); zend_string *str2 = zend_string_init(classname2, strlen(classname2), 0);
ce = zend_lookup_class(str); // May autoload the class. ce = zend_lookup_class(str2); // May autoload the class.
zend_string_release (str); zend_string_release (str2);
free(classname2); free(classname2);
if (!ce) { if (!ce) {

Loading…
Cancel
Save