diff options
-rw-r--r-- | gtk/src/callbacks.c | 6 | ||||
-rw-r--r-- | gtk/src/create_resources.c | 1 | ||||
-rw-r--r-- | gtk/src/presets.c | 6 | ||||
-rw-r--r-- | libhb/dvd.c | 2 | ||||
-rw-r--r-- | libhb/muxmkv.c | 6 | ||||
-rw-r--r-- | libhb/ports.c | 1 |
6 files changed, 17 insertions, 5 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); diff --git a/libhb/dvd.c b/libhb/dvd.c index bd167e775..5dbe85072 100644 --- a/libhb/dvd.c +++ b/libhb/dvd.c @@ -146,7 +146,7 @@ hb_dvd_t * hb_dvdread_init( char * path ) fail: if( d->vmg ) ifoClose( d->vmg ); if( d->reader ) DVDClose( d->reader ); - free( d ); + free( e ); return NULL; } diff --git a/libhb/muxmkv.c b/libhb/muxmkv.c index 1140bc5b0..227159579 100644 --- a/libhb/muxmkv.c +++ b/libhb/muxmkv.c @@ -77,6 +77,7 @@ static int MKVInit( hb_mux_object_t * m ) hb_error( "Could not create output file, Disk Full?" ); job->mux_data = NULL; *job->die = 1; + free(track); return 0; } @@ -94,8 +95,10 @@ static int MKVInit( hb_mux_object_t * m ) /* Taken from x264 muxers.c */ avcC_len = 5 + 1 + 2 + job->config.h264.sps_length + 1 + 2 + job->config.h264.pps_length; avcC = malloc(avcC_len); - if (avcC == NULL) + if (avcC == NULL) { + free(track); return -1; + } avcC[0] = 1; avcC[1] = job->config.h264.sps[1]; /* AVCProfileIndication */ @@ -158,6 +161,7 @@ static int MKVInit( hb_mux_object_t * m ) default: *job->die = 1; hb_error("muxmkv: Unknown video codec: %x", job->vcodec); + free(track); return 0; } diff --git a/libhb/ports.c b/libhb/ports.c index 6ccbaede3..cec4efd96 100644 --- a/libhb/ports.c +++ b/libhb/ports.c @@ -693,6 +693,7 @@ hb_net_t * hb_net_open( char * address, int port ) if (iResult != 0) { hb_log("WSAStartup failed: %d", iResult); + free(n); return NULL; } winsock_init = 1; |