Mercurial > ~mikael > mcabber > hg
comparison mcabber/src/otr.c @ 1307:6c116207ab2e
Work around segfault in otrl_userstate_free()
It only occurs when SSL is enabled and mcabber is linked to libgnutls.
Seems to be a problem in libgcrypt when both libotr and libgnutls use it.
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 09 Sep 2007 17:44:34 +0200 |
parents | a7d21918234c |
children | b17754d9221b |
comparison
equal
deleted
inserted
replaced
1306:a7d21918234c | 1307:6c116207ab2e |
---|---|
139 if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) | 139 if (ctx->msgstate == OTRL_MSGSTATE_ENCRYPTED) |
140 otr_message_disconnect(ctx); | 140 otr_message_disconnect(ctx); |
141 | 141 |
142 g_free(account); | 142 g_free(account); |
143 account = NULL; | 143 account = NULL; |
144 | |
145 /* XXX This #ifdef is a quick workaround: when mcabber | |
146 * is linked to both gnutls and libotr, libgcrypt will | |
147 * segfault when we call otrl_userstate_free(). | |
148 * This is reported to be a bug in libgcrypt :-/ | |
149 * Mikael | |
150 */ | |
151 #if defined(HAVE_GNUTLS) && !defined(HAVE_OPENSSL) | |
152 if (!settings_opt_get_int("ssl")) | |
153 #endif | |
144 otrl_userstate_free(userstate); | 154 otrl_userstate_free(userstate); |
155 | |
145 userstate = NULL; | 156 userstate = NULL; |
146 g_free(keyfile); | 157 g_free(keyfile); |
147 keyfile = NULL; | 158 keyfile = NULL; |
148 } | 159 } |
149 | 160 |