summaryrefslogtreecommitdiff
path: root/i3status.c
diff options
context:
space:
mode:
Diffstat (limited to 'i3status.c')
-rw-r--r--i3status.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/i3status.c b/i3status.c
index 558f8ab..2cded06 100644
--- a/i3status.c
+++ b/i3status.c
@@ -111,6 +111,9 @@ static void *scalloc(size_t size) {
}
char *sstrdup(const char *str) {
+ if (str == NULL) {
+ return NULL;
+ }
char *result = strdup(str);
exit_if_null(result, "Error: out of memory (strdup())\n");
return result;