aboutsummaryrefslogtreecommitdiff
path: root/core/device.c
diff options
context:
space:
mode:
authorStewart Smith <stewart@linux.vnet.ibm.com>2015-11-12 09:21:23 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-11-12 09:21:23 +1100
commitda109ff66b42be2975ed5ee44e7926b0837320e1 (patch)
tree9bee3699b0f6ce8bc9565f5879d46b453ce8a6a5 /core/device.c
parentdfab2fb87c2d83e240a002e8829b525d10342df3 (diff)
downloadskiboot-da109ff66b42be2975ed5ee44e7926b0837320e1.zip
skiboot-da109ff66b42be2975ed5ee44e7926b0837320e1.tar.gz
skiboot-da109ff66b42be2975ed5ee44e7926b0837320e1.tar.bz2
Fix resource leak on crash (similar to 125f95e)
The error paths here are a bit suspicious anyway as we're allocating memory in a failure path for having failed to allocate memory. One can hope that the memory allocated to display the error is less than the memory we attempted to allocate in the first place. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core/device.c')
-rw-r--r--core/device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/core/device.c b/core/device.c
index 89e530f..c5f8634 100644
--- a/core/device.c
+++ b/core/device.c
@@ -321,8 +321,10 @@ static struct dt_property *new_property(struct dt_node *node,
char *path;
if (!p) {
+ path = dt_get_path(node);
prerror("Failed to allocate property \"%s\" for %s of %zu bytes\n",
- name, dt_get_path(node), size);
+ name, path, size);
+ free(path);
abort();
}
if (dt_find_property(node, name)) {