summaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2012-05-01 11:23:36 +0000
committerjstebbins <[email protected]>2012-05-01 11:23:36 +0000
commitdf3daf7cdd85794ef3d7f0eff181eb3b323a489f (patch)
treebb7e5295a613949f3b556d7baf5a43b387b551f6 /gtk
parent2e8be70b9910c62d8d8cb693f8c58485efbf4e97 (diff)
merge assorted fixes provided by Rogerio Brito
Pretty much all resource cleanup issues on error condition handling. Thanks Rogerio! git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4620 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'gtk')
-rw-r--r--gtk/src/callbacks.c6
-rw-r--r--gtk/src/create_resources.c1
-rw-r--r--gtk/src/presets.c6
3 files changed, 10 insertions, 3 deletions
diff --git a/gtk/src/callbacks.c b/gtk/src/callbacks.c
index ba0d569cc..a3b71ebb0 100644
--- a/gtk/src/callbacks.c
+++ b/gtk/src/callbacks.c
@@ -4966,15 +4966,17 @@ ghb_check_update(signal_user_data_t *ud)
if (host == NULL || appcast == NULL)
return NULL;
- query = g_strdup_printf( "GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n",
+ query = g_strdup_printf("GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n",
appcast, host);
ioc = ghb_net_open(ud, host, 80);
if (ioc == NULL)
- return NULL;
+ goto free_resources;
g_io_channel_write_chars(ioc, query, strlen(query), &len, &gerror);
g_io_channel_flush(ioc, &gerror);
+
+free_resources:
g_free(query);
g_free(host);
g_free(appcast);
diff --git a/gtk/src/create_resources.c b/gtk/src/create_resources.c
index 3a979bd87..ca5ea828b 100644
--- a/gtk/src/create_resources.c
+++ b/gtk/src/create_resources.c
@@ -531,6 +531,7 @@ main(gint argc, gchar *argv[])
gval = ghb_resource_parse_file(file);
ghb_plist_write_file(dst, gval);
+ fclose(file);
return 0;
}
diff --git a/gtk/src/presets.c b/gtk/src/presets.c
index 70b23ed6b..cc2f23e8a 100644
--- a/gtk/src/presets.c
+++ b/gtk/src/presets.c
@@ -431,7 +431,10 @@ presets_find_pos(const GValue *path, gint type, gint *len)
val = ghb_array_get_nth(path, ii);
name = g_value_get_string(val);
indices[ii] = presets_find_element(nested, name);
- if (indices[ii] == -1) return NULL;
+ if (indices[ii] == -1) {
+ g_free(indices);
+ return NULL;
+ }
dict = ghb_array_get_nth(nested, indices[ii]);
folder = ghb_value_boolean(preset_dict_get_value(dict, "Folder"));
nested = NULL;
@@ -1683,6 +1686,7 @@ ghb_presets_list_init(
if (presets == NULL)
{
g_warning("Failed to find parent folder when adding child.");
+ g_free(more_indices);
return;
}
count = ghb_array_len(presets);