summaryrefslogtreecommitdiff
path: root/src/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index 978f169..95d06c2 100644
--- a/src/core.c
+++ b/src/core.c
@@ -73,7 +73,7 @@ static void nslog__log_corked(nslog_entry_context_t *ctx,
va_list args)
{
/* If corked, we need to store a copy */
- struct nslog_cork_chain *newcork = malloc(sizeof(*newcork) + measured_len + 1);
+ struct nslog_cork_chain *newcork = calloc(sizeof(struct nslog_cork_chain) + measured_len + 1, 1);
if (newcork == NULL) {
/* Wow, something went wrong */
return;
@@ -157,6 +157,8 @@ nslog_error nslog_uncork()
free(ent);
}
nslog__corked = false;
+ return NSLOG_NO_ERROR;
+ } else {
+ return NSLOG_UNCORKED;
}
- return NSLOG_NO_ERROR;
}