aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/device.c b/core/device.c
index 09f76d7..ba427de 100644
--- a/core/device.c
+++ b/core/device.c
@@ -348,6 +348,9 @@ struct dt_property *dt_add_property_nstr(struct dt_node *node,
struct dt_property *p;
char *tmp = zalloc(vlen + 1);
+ if (!tmp)
+ return NULL;
+
strncpy(tmp, value, vlen);
p = dt_add_property(node, name, tmp, strlen(tmp)+1);
free(tmp);