summaryrefslogtreecommitdiffstats
path: root/ListItem.c
diff options
context:
space:
mode:
authorHisham <hisham@gobolinux.org>2016-02-02 15:53:02 +0100
committerHisham <hisham@gobolinux.org>2016-02-02 15:53:02 +0100
commitb54d2dde407921caa7561dde6b45831ba93d0840 (patch)
treecd81eea35dd65e46d22f2801ea403e1efc06eb59 /ListItem.c
parenta1f7f2869ec2bd860d5b4e4b39736ca877afdf6f (diff)
Check for failure in allocations.
Diffstat (limited to 'ListItem.c')
-rw-r--r--ListItem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ListItem.c b/ListItem.c
index a675327d..c9e906fa 100644
--- a/ListItem.c
+++ b/ListItem.c
@@ -61,7 +61,7 @@ ObjectClass ListItem_class = {
ListItem* ListItem_new(const char* value, int key) {
ListItem* this = AllocThis(ListItem);
- this->value = strdup(value);
+ this->value = xStrdup(value);
this->key = key;
this->moving = false;
return this;
@@ -71,7 +71,7 @@ void ListItem_append(ListItem* this, const char* text) {
int oldLen = strlen(this->value);
int textLen = strlen(text);
int newLen = strlen(this->value) + textLen;
- this->value = realloc(this->value, newLen + 1);
+ this->value = xRealloc(this->value, newLen + 1);
memcpy(this->value + oldLen, text, textLen);
this->value[newLen] = '\0';
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy