aboutsummaryrefslogtreecommitdiff
path: root/dico
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2008-08-09 19:07:06 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2008-08-09 19:07:06 +0300
commit22ea689b41ee98e919241275eb2249f407ce4f85 (patch)
tree79d3b582aed7eb9a59f393d75b8967abb7039c37 /dico
parentd0f76f87599f96a5ef7a1920fc0bcc29910e1a16 (diff)
downloaddico-22ea689b41ee98e919241275eb2249f407ce4f85.tar.gz
dico-22ea689b41ee98e919241275eb2249f407ce4f85.tar.bz2
Bugfixes in SASL-related code.
* dico/saslauth.c (selectmech): Do not use _free_el to deallocate elements of impl. This avoids duplicate calls to free. (sasl_free_data): Do nothing if *pdata is NULL. * dicod/gsasl.c (callback): Fix coredump. * lib/xutil.c (xdico_sasl_capa_match_p): Use c_strcasecmp.
Diffstat (limited to 'dico')
-rw-r--r--dico/autologin.c5
-rw-r--r--dico/connect.c3
-rw-r--r--dico/saslauth.c8
3 files changed, 10 insertions, 6 deletions
diff --git a/dico/autologin.c b/dico/autologin.c
index 02068fc..ba7e6cd 100644
--- a/dico/autologin.c
+++ b/dico/autologin.c
@@ -308,9 +308,10 @@ parse_autologin(const char *filename, char *host, struct auth_cred *pcred,
filename, line);
exit(1);
}
- for (i = 0; i < c; i++)
+
+ for (i = 0; i < c; i++)
xdico_list_append(pcred->mech, v[i]);
-
+
free(v);
break;
}
diff --git a/dico/connect.c b/dico/connect.c
index 4c022dc..8f975ba 100644
--- a/dico/connect.c
+++ b/dico/connect.c
@@ -658,7 +658,7 @@ void
dict_conn_close(struct dict_connection *conn)
{
struct dict_result *res;
-
+#if 0
dico_stream_close(conn->str);
dico_stream_destroy(&conn->str);
free(conn->msgid);
@@ -669,6 +669,7 @@ dict_conn_close(struct dict_connection *conn)
dict_result_free(res);
res = prev;
}
+#endif
obstack_free(&conn->stk, NULL);
free(conn);
}
diff --git a/dico/saslauth.c b/dico/saslauth.c
index f2129ff..aa2e6e1 100644
--- a/dico/saslauth.c
+++ b/dico/saslauth.c
@@ -99,7 +99,7 @@ selectmech(struct dict_connection *conn, Gsasl *ctx, struct auth_cred *cred)
itr = xdico_iterator_create(impl);
mech = mech_intersect_first(itr, conn);
dico_iterator_destroy(&itr);
- dico_list_destroy(&impl, _free_el, NULL);
+ dico_list_destroy(&impl, NULL, NULL);
if (mech)
upcase(mech);
return mech;
@@ -174,8 +174,10 @@ sasl_read_response(struct dict_connection *conn, char **data)
static void
sasl_free_data(struct dict_connection *conn, char **pdata)
{
- obstack_free(&conn->stk, *pdata);
- *pdata = NULL;
+ if (*pdata) {
+ obstack_free(&conn->stk, *pdata);
+ *pdata = NULL;
+ }
}
int

Return to:

Send suggestions and report system problems to the System administrator.