[pan2] fix for segfault with nntp-pool
- From: Heinrich MÃller <henmull src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan2] fix for segfault with nntp-pool
- Date: Fri, 1 Jun 2012 17:51:23 +0000 (UTC)
commit 275e6373a67dfcfcf03edfaee092e429fa9a4743
Author: Heinrich MÃller <henmull src gnome org>
Date: Fri Jun 1 19:50:53 2012 +0200
fix for segfault with nntp-pool
pan/data-impl/server.cc | 4 ++--
pan/tasks/nntp-pool.cc | 12 +++++++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/pan/data-impl/server.cc b/pan/data-impl/server.cc
index c549c45..40f27c0 100644
--- a/pan/data-impl/server.cc
+++ b/pan/data-impl/server.cc
@@ -231,11 +231,11 @@ DataImpl :: get_server_auth (const Quark & server,
if (found) {
setme_username = s->username;
#ifndef HAVE_GKR
- setme_password = (gchar*)s->password.c_str();
+ setme_password = g_strdup(s->password.c_str());
#else
if (!use_gkr)
{
- setme_password = (gchar*)s->password.c_str();
+ setme_password = g_strdup(s->password.c_str());
}
else if (s->gkr_pw)
{
diff --git a/pan/tasks/nntp-pool.cc b/pan/tasks/nntp-pool.cc
index f4ddc0d..17a7c09 100644
--- a/pan/tasks/nntp-pool.cc
+++ b/pan/tasks/nntp-pool.cc
@@ -186,7 +186,17 @@ NNTP_Pool :: on_socket_created (const StringView & host,
{
// okay, we at least we established a connection.
// now try to handshake and pass the buck to on_nntp_done().
- NNTP * nntp = new NNTP (_server, user, pass, socket);
+ NNTP * nntp;
+ if (!_prefs.get_flag("use-gnome-keyring", false))
+ {
+ std::string pw (pass ? pass : "");
+ if (pass) g_free(pass);
+ nntp = new NNTP (_server, user, pw, socket);
+ }
+ else
+ {
+ nntp = new NNTP (_server, user, pass, socket);
+ }
nntp->handshake (this);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]