aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--vcal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/vcal.c b/vcal.c
index 61d6fbb8..e93750ee 100644
--- a/vcal.c
+++ b/vcal.c
@@ -115,7 +115,7 @@ int vcomponent_push_val (vcomponent* comp, const char* key, const char* val) {
strbuf_load(&cs->key, val);
PUSH(content_line)(cl, cs);
- char* key_cpy = calloc(sizeof(*key_cpy), strlen(key));
+ char* key_cpy = calloc(sizeof(*key_cpy), strlen(key) + 1);
strcpy (key_cpy, key);
PUSH(TRIE(content_line))(&comp->clines, key_cpy, cl);
free (key_cpy);
@@ -124,7 +124,7 @@ int vcomponent_push_val (vcomponent* comp, const char* key, const char* val) {
}
char* vcomponent_get_val (vcomponent* comp, const char* key) {
- char* key_cpy = calloc(sizeof(*key_cpy), strlen(key));
+ char* key_cpy = calloc(sizeof(*key_cpy), strlen(key) + 1);
strcpy (key_cpy, key);
content_line* cl = GET(TRIE(content_line))(&comp->clines, key_cpy);
free (key_cpy);