summaryrefslogtreecommitdiff
path: root/guile
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2011-04-05 23:59:06 +0200
committerNikos Mavrogiannopoulos <nmav@gnutls.org>2011-04-06 00:03:29 +0200
commit065fd9d64cb790c1c129c776dcdb83f62db374c9 (patch)
treeebf021a2559610209a1de8d3f6676269a8a295b0 /guile
parent7c0b2d5685cec15827c47ff38f3e75a56dec846e (diff)
downloadgnutls-065fd9d64cb790c1c129c776dcdb83f62db374c9.tar.gz
avoid using a freed pointer.
Diffstat (limited to 'guile')
-rw-r--r--guile/src/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/guile/src/core.c b/guile/src/core.c
index afdbd93047..4e0f340727 100644
--- a/guile/src/core.c
+++ b/guile/src/core.c
@@ -550,11 +550,15 @@ SCM_DEFINE (scm_gnutls_set_session_priorities_x,
char *c_priorities;
const char *err_pos;
gnutls_session_t c_session;
+ size_t pos;
c_session = scm_to_gnutls_session (session, 1, FUNC_NAME);
c_priorities = scm_to_locale_string (priorities); /* XXX: to_latin1_string */
err = gnutls_priority_set_direct (c_session, c_priorities, &err_pos);
+ if (err == GNUTLS_E_INVALID_REQUEST)
+ pos = err_pos - c_priorities;
+
free (c_priorities);
switch (err)
@@ -563,8 +567,6 @@ SCM_DEFINE (scm_gnutls_set_session_priorities_x,
break;
case GNUTLS_E_INVALID_REQUEST:
{
- size_t pos;
- pos = err_pos - c_priorities;
scm_gnutls_error_with_args (err, FUNC_NAME,
scm_list_1 (scm_from_size_t (pos)));
break;