umad_get_ca() should free the allocated 'ports' memory on failure,
not the ca structure, which is provided by the user.
Bug reported by Leonid Keller.
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
git-svn-id: svn://openib.tc.cornell.edu/gen1@2677
ad392aa1-c5ef-ae45-8dd8-
e69d62a5ef86
\r
ret = umad_query_port(context, ca->ports[i]);\r
if (ret != 0) {\r
+ delete ports;\r
goto close;\r
}\r
}\r
ibv_close_device(context);\r
free:\r
ibv_free_device_list(list);\r
- if (ret != 0) {\r
- delete ca;\r
- }\r
return ret;\r
}\r
\r