summaryrefslogtreecommitdiff
path: root/gtk2_ardour/sfdb_freesound_mootcher.cc
diff options
context:
space:
mode:
authorCarl Hetherington <carl@carlh.net>2012-04-07 02:08:18 +0000
committerCarl Hetherington <carl@carlh.net>2012-04-07 02:08:18 +0000
commitd23a97a6acd0c12c0694accaf6c875a13d5fcb1b (patch)
tree090e8f05c85c2a24998181d478be7af94cca354f /gtk2_ardour/sfdb_freesound_mootcher.cc
parentbf2281d36633e69acb573206d36a709b1eeba9ca (diff)
Clean up possibly-null pointer dereference (#4812).
git-svn-id: svn://localhost/ardour2/branches/3.0@11813 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/sfdb_freesound_mootcher.cc')
-rw-r--r--gtk2_ardour/sfdb_freesound_mootcher.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/gtk2_ardour/sfdb_freesound_mootcher.cc b/gtk2_ardour/sfdb_freesound_mootcher.cc
index a1bffecfeb..7e13c4f68b 100644
--- a/gtk2_ardour/sfdb_freesound_mootcher.cc
+++ b/gtk2_ardour/sfdb_freesound_mootcher.cc
@@ -187,17 +187,16 @@ std::string Mootcher::doRequest(std::string uri, std::string params)
return "";
}
- result = xml_page.memory;
// free the memory
- if(xml_page.memory){
- free( xml_page.memory );
- xml_page.memory = NULL;
- xml_page.size = 0;
+ if (xml_page.memory) {
+ result = xml_page.memory;
}
+
+ free (xml_page.memory);
+ xml_page.memory = NULL;
+ xml_page.size = 0;
-//printf("freesound result: %s\n", result.c_str());
return result;
-
}