summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-cache/src/ioc-inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance/io-cache/src/ioc-inode.c')
-rw-r--r--xlators/performance/io-cache/src/ioc-inode.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xlators/performance/io-cache/src/ioc-inode.c b/xlators/performance/io-cache/src/ioc-inode.c
index c131a48f2b7..ab1d7b60074 100644
--- a/xlators/performance/io-cache/src/ioc-inode.c
+++ b/xlators/performance/io-cache/src/ioc-inode.c
@@ -48,8 +48,14 @@ str_to_ptr (char *string)
char *
ptr_to_str (void *ptr)
{
+ int ret = 0;
char *str = NULL;
- asprintf (&str, "%p", ptr);
+ ret = asprintf (&str, "%p", ptr);
+ if (-1 == ret) {
+ gf_log ("ioc", GF_LOG_ERROR,
+ "asprintf failed while converting ptr to str");
+ return NULL;
+ }
return str;
}