summaryrefslogtreecommitdiffstats
path: root/src/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format.c')
-rw-r--r--src/format.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/format.c b/src/format.c
index e17fac0..ee6b8f3 100644
--- a/src/format.c
+++ b/src/format.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008,2010,2011,2012,2013 Red Hat, Inc.
+ * Copyright 2008,2010,2011,2012,2013,2014 Red Hat, Inc.
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -4089,6 +4089,9 @@ format_expand_simple(struct plugin_state *state,
replaceall = NULL;
replaceval = NULL;
expr = strdup(fmt);
+ if (expr == NULL) {
+ return -ENOMEM;
+ }
/* It's a simple expression, so evaluate it. Check for substitutions
* and text to be stripped if the magic character occurs before the
* default/alternate signals. */