Browse Source

Prevent glib CRITICAL errors for NULL pointers

pull/1020/head
Stefan Mititelu 6 years ago
parent
commit
aa98d7f86c
2 changed files with 10 additions and 5 deletions
  1. +2
    -1
      daemon/tcp_listener.c
  2. +8
    -4
      lib/auxlib.c

+ 2
- 1
daemon/tcp_listener.c View File

@ -247,7 +247,8 @@ void streambuf_listener_shutdown(struct streambuf_listener *listener) {
return;
poller_del_item(listener->poller, listener->listener.fd);
close_socket(&listener->listener);
g_hash_table_destroy(listener->streams);
if (listener->streams)
g_hash_table_destroy(listener->streams);
}
void streambuf_stream_close(struct streambuf_stream *s) {


+ 8
- 4
lib/auxlib.c View File

@ -102,16 +102,20 @@ void config_load_free(struct rtpengine_common_config *cconfig) {
}
static void free_gkeyfile(GKeyFile **k) {
g_key_file_free(*k);
if (k && *k)
g_key_file_free(*k);
}
static void free_gopte(GOptionEntry **k) {
free(*k);
if (k && *k)
free(*k);
}
static void free_goptc(GOptionContext **k) {
g_option_context_free(*k);
if (k && *k)
g_option_context_free(*k);
}
static void free_gerror(GError **k) {
g_error_free(*k);
if (k && *k)
g_error_free(*k);
}
void config_load(int *argc, char ***argv, GOptionEntry *app_entries, const char *description,


Loading…
Cancel
Save