From d5683ba0fc3e56724d0669192a660c9cfc6a9bef Mon Sep 17 00:00:00 2001 From: Rob Brand Date: Mon, 8 Jun 2015 14:30:11 +0100 Subject: [PATCH] Fix seg fault when calling git_treebuilder_create --- treebuilder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/treebuilder.c b/treebuilder.c index 09cabd2162..9e1526b96f 100644 --- a/treebuilder.c +++ b/treebuilder.c @@ -49,10 +49,10 @@ PHP_FUNCTION(git_treebuilder_create) return; } if (source != NULL) { + ZEND_FETCH_RESOURCE(_source, php_git2_t*, &source, -1, PHP_GIT2_RESOURCE_NAME, git2_resource_handle); tree = PHP_GIT2_V(_source, tree); } - ZEND_FETCH_RESOURCE(_source, php_git2_t*, &source, -1, PHP_GIT2_RESOURCE_NAME, git2_resource_handle); error = git_treebuilder_create(&out, tree); if (php_git2_check_error(error, "git_treebuilder_create" TSRMLS_CC)) { RETURN_FALSE;