summaryrefslogtreecommitdiff
path: root/src/signature.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2016-02-15 11:30:48 +0100
committerPatrick Steinhardt <ps@pks.im>2016-02-18 20:50:33 +0100
commit038d7af08595eabaa3d23da4703f25f4517af365 (patch)
treea4a68013bd329e7bc044832a46146e25d72d2d84 /src/signature.c
parent40f6f225175375b41317b0a4e98e8865600d1682 (diff)
downloadlibgit2-038d7af08595eabaa3d23da4703f25f4517af365.tar.gz
signature: use GITERR_CHECK_ALLOC to check for OOM situation
When checking for out of memory situations we usually use the GITERR_CHECK_ALLOC macro. Besides conforming to our current code base it adds the benefit of silencing errors in Coverity due to Coverity handling the macro's error path as abort.
Diffstat (limited to 'src/signature.c')
-rw-r--r--src/signature.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/signature.c b/src/signature.c
index 109476efe..d07c93323 100644
--- a/src/signature.c
+++ b/src/signature.c
@@ -79,10 +79,9 @@ int git_signature_new(git_signature **sig_out, const char *name, const char *ema
GITERR_CHECK_ALLOC(p);
p->name = extract_trimmed(name, strlen(name));
+ GITERR_CHECK_ALLOC(p->name);
p->email = extract_trimmed(email, strlen(email));
-
- if (p->name == NULL || p->email == NULL)
- return -1; /* oom */
+ GITERR_CHECK_ALLOC(p->email);
if (p->name[0] == '\0' || p->email[0] == '\0') {
git_signature_free(p);