Skip to content

Commit

Permalink
fix memory leak during conversion of midgard_datetime to gvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
indeyets committed Mar 11, 2011
1 parent 9fd044e commit 3149328
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion php_midgard_timestamp_api.c
Expand Up @@ -26,11 +26,12 @@ zval *php_midgard_datetime_get_timestamp(const zval *object TSRMLS_DC)
/* Prepare DateTime::format argument */
zval *fmt;
MAKE_STD_ZVAL(fmt);
ZVAL_STRING(fmt, "c", 0);
ZVAL_STRING(fmt, "c", 1);

/* Invoke Datetime::format */
zval *_retval;
zend_call_method_with_1_params((zval **)&object, Z_OBJCE_P(object), NULL, "format", &_retval, fmt);
zval_ptr_dtor(&fmt);

return _retval;
}
Expand Down

0 comments on commit 3149328

Please sign in to comment.