]> sjero.net Git - linphone/commitdiff
add sanity check in linphone_core_remove_proxy_config()
authorSimon Morlat <simon.morlat@linphone.org>
Wed, 15 Feb 2012 20:48:34 +0000 (21:48 +0100)
committerSimon Morlat <simon.morlat@linphone.org>
Wed, 15 Feb 2012 20:48:34 +0000 (21:48 +0100)
fix compilation without tunnel (stubs are needed and must be declared as extern "c"

coreapi/linphone_tunnel.cc
coreapi/proxy.c
mediastreamer2

index 337ca3089ad6b5ca0bc3e28a678b6863a6686f76..1cc940f4b4c0a6d1065c2063c1e689a6e06b3eae 100644 (file)
@@ -25,8 +25,8 @@
 
 #ifdef TUNNEL_ENABLED
 #include "TunnelManager.hh"
-#include "linphone_tunnel.h"
 #endif
+#include "linphone_tunnel.h"
 #include "linphonecore.h"
 #include "private.h"
 #include "lpconfig.h"
index a01f1ffd0d37e7f12fad6b3226dd74932550e4df..18999dae0bfe7895fe165cd3b498536da240186a 100644 (file)
@@ -538,6 +538,11 @@ int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cfg){
  * on a deleted list. For that reason, a removed proxy does NOT need to be freed.
 **/
 void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cfg){
+       /* check this proxy config is in the list before doing more*/
+       if (ms_list_find(lc->sip_conf.proxies,cfg)==NULL){
+               ms_error("linphone_core_remove_proxy_config: LinphoneProxyConfig %p is not known by LinphoneCore (programming error?)",cfg);
+               return;
+       }
        lc->sip_conf.proxies=ms_list_remove(lc->sip_conf.proxies,(void *)cfg);
        /* add to the list of destroyed proxies, so that the possible unREGISTER request can succeed authentication */
        lc->sip_conf.deleted_proxies=ms_list_append(lc->sip_conf.deleted_proxies,(void *)cfg);
index 902cd8d36daef0913ac235b283668e5b3dbda515..405a3d140e76e28ee5c762321a8dbca133a9fe07 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 902cd8d36daef0913ac235b283668e5b3dbda515
+Subproject commit 405a3d140e76e28ee5c762321a8dbca133a9fe07