]> granicus.if.org Git - php/commitdiff
Merge branch 'refactoring2' of github.com:zendtech/php into refactoring2
authorXinchen Hui <laruence@gmail.com>
Thu, 6 Mar 2014 11:03:22 +0000 (19:03 +0800)
committerXinchen Hui <laruence@gmail.com>
Thu, 6 Mar 2014 11:03:22 +0000 (19:03 +0800)
Conflicts:
ext/standard/formatted_print.c

1  2 
ext/standard/formatted_print.c

index df5b22cdf4d6b76dea854671bb9ebf296b3f64db,325b242122eb4c985c4a000a8241160f78cd0ea5..1ffc836f99963d59c8c2be78df4cc2de6af5b127
@@@ -491,10 -492,10 +492,13 @@@ php_formatted_print(int param_count, in
                                        PRINTF_DEBUG(("sprintf: getting width\n"));
                                        if ((width = php_sprintf_getnumber(format, &inpos)) < 0) {
                                                efree(result);
+                                               if (newargs) {
+                                                       efree(newargs);
+                                               }
                                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Width must be greater than zero and less than %d", INT_MAX);
 +                                              if (newargs) {
 +                                                      efree(newargs);
 +                                              }
                                                return NULL;
                                        }
                                        adjusting |= ADJ_WIDTH;
                                        if (isdigit((int)format[inpos])) {
                                                if ((precision = php_sprintf_getnumber(format, &inpos)) < 0) {
                                                        efree(result);
+                                                       if (newargs) {
+                                                               efree(newargs);
+                                                       }
                                                        php_error_docref(NULL TSRMLS_CC, E_WARNING, "Precision must be greater than zero and less than %d", INT_MAX);
 +                                                      if (newargs) {
 +                                                              efree(newargs);
 +                                                      }
                                                        return NULL;
                                                }
                                                adjusting |= ADJ_PRECISION;
  
                        if (argnum >= argc) {
                                efree(result);
+                               if (newargs) {
+                                       efree(newargs);
+                               }
                                php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments");
 +                              if (newargs) {
 +                                      efree(newargs);
 +                              }
                                return NULL;
                        }