Commit 42c05ed56b3bc4f5963a8c68ec6fec803b7e22e3

Patrick Steinhardt 2016-02-23T10:02:44

path: use GITERR_CHECK_ALLOC_BUF to verify passed in buffer

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/path.c b/src/path.c
index 852ef57..1fd14fc 100644
--- a/src/path.c
+++ b/src/path.c
@@ -705,8 +705,7 @@ int git_path_resolve_relative(git_buf *path, size_t ceiling)
 	char *base, *to, *from, *next;
 	size_t len;
 
-	if (!path || git_buf_oom(path))
-		return -1;
+	GITERR_CHECK_ALLOC_BUF(path);
 
 	if (ceiling > path->size)
 		ceiling = path->size;