summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/transport.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2009-07-17 22:41:44 +0000
committerAnand V. Avati <avati@dev.gluster.com>2009-07-20 14:28:53 -0700
commit632cce5e720acaa28ab680a6850f2aa8289d4628 (patch)
tree8cdc8afe41411ecde9c7a80b49162088bb09e08e /libglusterfs/src/transport.c
parent5be3c142978257032bd11ad420382859fc204702 (diff)
fix build warnings in 'libglusterfs/'
return value of 'asprintf' was not checked, and the flow was continuing without returning error, which could cause potential segfaults in code (mostly possible during ENOMEM case). Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 130 (build warnings) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=130
Diffstat (limited to 'libglusterfs/src/transport.c')
-rw-r--r--libglusterfs/src/transport.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libglusterfs/src/transport.c b/libglusterfs/src/transport.c
index 244aa960b78..7464ffd664f 100644
--- a/libglusterfs/src/transport.c
+++ b/libglusterfs/src/transport.c
@@ -136,7 +136,11 @@ transport_load (dict_t *options,
goto fail;
}
- asprintf (&name, "%s/%s.so", TRANSPORTDIR, type);
+ ret = asprintf (&name, "%s/%s.so", TRANSPORTDIR, type);
+ if (-1 == ret) {
+ gf_log ("transport", GF_LOG_ERROR, "asprintf failed");
+ goto fail;
+ }
gf_log ("transport", GF_LOG_DEBUG,
"attempt to load file %s", name);