summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-03-30 14:44:56 +0000
committerDavid Robillard <d@drobilla.net>2009-03-30 14:44:56 +0000
commitd909a9f409849dfe4072f2f57fdd2349ca8a0a3c (patch)
tree4364f25265aca621db2208505e39f4f183ff7b5a /utils
parent8a24811ad2d2e587af6fe5ad487af08f74bccf38 (diff)
downloadlilv-d909a9f409849dfe4072f2f57fdd2349ca8a0a3c.tar.gz
lilv-d909a9f409849dfe4072f2f57fdd2349ca8a0a3c.tar.bz2
lilv-d909a9f409849dfe4072f2f57fdd2349ca8a0a3c.zip
Fix memory leaks.
Document ownership semantics of query value accessors. Fix test ccflags for new waf. git-svn-id: http://svn.drobilla.net/lad/trunk/slv2@1951 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'utils')
-rw-r--r--utils/lv2_inspect.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/utils/lv2_inspect.c b/utils/lv2_inspect.c
index f985a69..2bb13a4 100644
--- a/utils/lv2_inspect.c
+++ b/utils/lv2_inspect.c
@@ -262,6 +262,7 @@ print_usage()
int
main(int argc, char** argv)
{
+ int ret = 0;
setlocale (LC_ALL, "");
SLV2World world = slv2_world_new();
@@ -272,18 +273,22 @@ main(int argc, char** argv)
if (argc != 2) {
print_usage();
- return -1;
+ ret = 1;
+ goto done;
}
if (!strcmp(argv[1], "--version")) {
print_version();
- return 0;
+ ret = 0;
+ goto done;
} else if (!strcmp(argv[1], "--help")) {
print_usage();
- return 0;
+ ret = 0;
+ goto done;
} else if (argv[1][0] == '-') {
print_usage();
- return -1;
+ ret = 2;
+ goto done;
}
SLV2Plugins plugins = slv2_world_get_all_plugins(world);
@@ -297,9 +302,15 @@ main(int argc, char** argv)
fprintf(stderr, "Plugin not found.\n");
}
+ ret = (p != NULL ? 0 : -1);
+
slv2_value_free(uri);
slv2_plugins_free(world, plugins);
- slv2_world_free(world);
- return (p != NULL ? 0 : -1);
+done:
+ slv2_value_free(event_class);
+ slv2_value_free(control_class);
+ slv2_world_free(world);
+ return ret;
}
+