]> granicus.if.org Git - php/commitdiff
Fixed valgrind issues
authorXinchen Hui <laruence@php.net>
Thu, 31 Jul 2014 10:15:47 +0000 (18:15 +0800)
committerXinchen Hui <laruence@php.net>
Thu, 31 Jul 2014 10:15:47 +0000 (18:15 +0800)
ext/intl/collator/collator_convert.c
ext/intl/transliterator/transliterator_methods.c

index 3f5dd3ae66b35a9c887211799c3f2dc4fe9917fc..e1ec3b1631fd6228be18b6a218791cc63e37b940 100644 (file)
@@ -63,9 +63,11 @@ static void collator_convert_hash_item_from_utf8_to_utf16(
                return;
 
        /* Update current hash item with the converted value. */
-       ZVAL_STRINGL( &znew_val, (char*)new_val, UBYTES(new_val_len) );
+       ZVAL_STRINGL( &znew_val, (char*)new_val, UBYTES(new_val_len + 1) );
        //???
        efree(new_val);
+       /* hack to fix use of initialized value */
+       Z_STRLEN(znew_val) = Z_STRLEN(znew_val) - UBYTES(1);
 
        if( hashKey)
        {
index 25edd005ef077823d15f95a98c1ee492f1917f37..4403de08aa06931c226da64dc8c0e62999dc9876 100644 (file)
@@ -463,7 +463,7 @@ cleanup:
                RETVAL_FALSE;
        }
 
-       zval_ptr_dtor( &tmp_object );
+       /* zval_ptr_dtor( &tmp_object ); */
 }
 /* }}} */