summaryrefslogtreecommitdiff
path: root/src/pool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pool.c')
-rw-r--r--src/pool.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/pool.c b/src/pool.c
index d484769e9..4796d0a81 100644
--- a/src/pool.c
+++ b/src/pool.c
@@ -217,7 +217,14 @@ char *git_pool_strdup(git_pool *pool, const char *str)
char *git_pool_strdup_safe(git_pool *pool, const char *str)
{
- return str ? git_pool_strdup(pool, str) : NULL;
+ if (!str)
+ return NULL;
+ else {
+ char *result = git_pool_strdup(pool, str);
+ if (!result)
+ giterr_clear();
+ return result;
+ }
}
char *git_pool_strcat(git_pool *pool, const char *a, const char *b)