aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rcfile_y.y13
-rw-r--r--socket.c6
2 files changed, 11 insertions, 8 deletions
diff --git a/rcfile_y.y b/rcfile_y.y
index 4ea4f866..b2578219 100644
--- a/rcfile_y.y
+++ b/rcfile_y.y
@@ -45,10 +45,6 @@ static struct query current; /* current server record */
static int prc_errflag;
static struct hostdata *leadentry;
static flag trailer;
-#if NET_SECURITY
-static struct net_security_operation request[NET_SECURITY_OPERATION_MAX];
-static int requestlen = NET_SECURITY_OPERATION_MAX;
-#endif /* NET_SECURITY */
static void record_current();
static void user_reset();
@@ -173,10 +169,15 @@ serv_option : AKA alias_list
| QVIRTUAL STRING {current.server.qvirtual=xstrdup($2);}
| NETSEC STRING {
#ifdef NET_SECURITY
- if (net_security_strtorequest($2, request, &requestlen))
+ void *request;
+ int requestlen;
+
+ if (net_security_strtorequest($2, &request, &requestlen))
yyerror("invalid security request");
- else
+ else {
current.server.netsec = xstrdup($2);
+ free(request);
+ }
#else
yyerror("network-security support disabled")
#endif /* NET_SECURITY */
diff --git a/socket.c b/socket.c
index bb68833c..3ba58696 100644
--- a/socket.c
+++ b/socket.c
@@ -38,7 +38,7 @@ int SockOpen(const char *host, const char *service, const char *options)
int i;
struct addrinfo *ai, req;
#if NET_SECURITY
- struct net_security_operation request[NET_SECURITY_OPERATION_MAX];
+ void *request = NULL;
int requestlen;
#endif /* NET_SECURITY */
@@ -54,10 +54,12 @@ int SockOpen(const char *host, const char *service, const char *options)
if (!options)
requestlen = 0;
else
- if (net_security_strtorequest((char *)options, request, &requestlen))
+ if (net_security_strtorequest((char *)options, &request, &requestlen))
goto ret;
i = inner_connect(ai, request, requestlen, NULL,NULL, "fetchmail", NULL);
+ if (request)
+ free(request);
ret:
#else /* NET_SECURITY */