about summary refs log tree commit homepage
path: root/mgmt_fn.c
diff options
context:
space:
mode:
Diffstat (limited to 'mgmt_fn.c')
-rw-r--r--mgmt_fn.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/mgmt_fn.c b/mgmt_fn.c
index c0d4571..a07fa60 100644
--- a/mgmt_fn.c
+++ b/mgmt_fn.c
@@ -17,7 +17,16 @@ get_path(struct iovec *dst, struct mog_mgmt *mgmt, char *buf, bool sdup)
                 char *path;
 
                 if (sdup) {
-                        path = xmalloc(dst->iov_len + 1);
+                        path = malloc(dst->iov_len + 1);
+                        if (!path) {
+                                struct iovec iov;
+
+                                IOV_STR(&iov, "ERROR: out-of-memory\r\n");
+                                mog_mgmt_writev(mgmt, &iov, 1);
+
+                                return NULL;
+                        }
+
                         memcpy(path, dst->iov_base, dst->iov_len);
                 } else {
                         path = dst->iov_base;