diff --git a/src/mount/mount.ceph.c b/src/mount/mount.ceph.c index 1345e7f451257..24d320833f2d1 100644 --- a/src/mount/mount.ceph.c +++ b/src/mount/mount.ceph.c @@ -40,6 +40,10 @@ static char *mount_resolve_src(const char *orig_str) char *mount_path; char *src; char *buf = strdup(orig_str); + if (!buf) { + fprintf(stderr, "%s: failed to allocate memory\n", __func__); + return NULL; + } mount_path = strstr(buf, ":/"); if (!mount_path) {