block: Check return value of mnt_fs_get_srcpath
[platform/core/system/storaged.git] / src / block / block.c
index 28924d0..6fbab38 100644 (file)
@@ -2199,6 +2199,9 @@ static int get_internal_storage_number(void)
                return -EPERM;
        }
        temp = mnt_fs_get_srcpath(fs);
+       if (!temp)
+               return -EPERM;
+
        name = strrchr(temp, '/');
        if (!name)
                return -EPERM;