Commit 69a09b7c6972343e321c7c0e3441fcc4b5340444

Vicent Marti 2010-11-19T17:17:46

Fix wrong pointer check in git__strdup Signed-off-by: Vicent Marti <tanoku@gmail.com>

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/src/util.c b/src/util.c
index eda4a4e..debf526 100644
--- a/src/util.c
+++ b/src/util.c
@@ -22,7 +22,7 @@ void *git__calloc(size_t a, size_t b)
 char *git__strdup(const char *s)
 {
 	char *r = strdup(s);
-	if (!s)
+	if (!r)
 		return git_ptr_error(GIT_ENOMEM);
 	return r;
 }