diff --git a/daemon/src/config/yamlparser.cpp b/daemon/src/config/yamlparser.cpp index 2dd58cfc3b1b0b98681a72694dbbae0d08a6257d..8a0b5129c8d03d2775ac5a2dfd6d2e82c9c94c5a 100644 --- a/daemon/src/config/yamlparser.cpp +++ b/daemon/src/config/yamlparser.cpp @@ -219,10 +219,7 @@ void YamlParser::processStream() void YamlParser::processDocument() { - doc_ = new YamlDocument(); - - if (!doc_) - throw YamlParserException("Not able to create new document"); + doc_ = new YamlDocument; for (; (eventIndex_ < eventNumber_) and (events_[eventIndex_].type != YAML_DOCUMENT_END_EVENT); ++eventIndex_) { switch (events_[eventIndex_].type) { @@ -366,6 +363,8 @@ void YamlParser::processMapping(YamlNode *topNode) void YamlParser::constructNativeData() { + if (!doc_) + throw YamlParserException("YAML Document not initialized"); Sequence *seq = doc_->getSequence(); for (Sequence::iterator iter = seq->begin(); iter != seq->end(); ++iter) { diff --git a/gnome/src/config/accountconfigdialog.c b/gnome/src/config/accountconfigdialog.c index 907118ca0dda432d8c9e476fbb526b66aae25891..259a25b7d78cb923de0eef6c21db2c9ccf3da23c 100644 --- a/gnome/src/config/accountconfigdialog.c +++ b/gnome/src/config/accountconfigdialog.c @@ -533,6 +533,7 @@ static void use_sip_tls_cb(GtkWidget *widget, gpointer data) static gchar * get_interface_addr_from_name(const gchar * const iface_name) { + g_assert(iface_name); #define UC(b) (((int)b)&0xff) int fd; @@ -567,6 +568,10 @@ static void local_interface_changed_cb(GtkWidget * widget UNUSED, gpointer data { if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(same_as_local_radio_button))) { gchar *local_iface_name = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(local_address_combo)); + if (!local_iface_name) { + ERROR("Could not get local interface name"); + return; + } gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name); gtk_entry_set_text(GTK_ENTRY(local_address_entry), local_iface_addr); @@ -888,6 +893,10 @@ create_network(const account_t *account) // Fill the text entry with the ip address of local interface selected local_address_entry = gtk_entry_new(); gchar *local_iface_name = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(local_address_combo)); + if (!local_iface_name) { + ERROR("Could not get local interface name"); + return frame; + } gchar *local_iface_addr = get_interface_addr_from_name(local_iface_name); g_free(local_iface_name); gtk_entry_set_text(GTK_ENTRY(local_address_entry), local_iface_addr); @@ -990,7 +999,6 @@ GtkWidget* create_published_address(const account_t *account) // This will trigger a signal, and the above two // widgets need to be instanciated before that. g_signal_connect(local_address_combo, "changed", G_CALLBACK(local_interface_changed_cb), local_address_combo); - g_signal_connect(same_as_local_radio_button, "toggled", G_CALLBACK(same_as_local_cb), same_as_local_radio_button); g_signal_connect(published_addr_radio_button, "toggled", G_CALLBACK(set_published_addr_manually_cb), published_addr_radio_button);