]> Pileus Git - ~andy/fetchmail/blobdiff - socket.c
Minor bug fixes for socket.c
[~andy/fetchmail] / socket.c
index 48201d3877641959117a3fc02d235eaffc3cb2f8..58a8e15e807e4258a717933b5603da522c08473f 100644 (file)
--- a/socket.c
+++ b/socket.c
@@ -133,6 +133,7 @@ static char *const *parse_plugin(const char *plugin, const char *host, const cha
        argvec = (char **)malloc(s);
        if (!argvec)
        {
+               free(plugin_copy);
                report(stderr, GT_("fetchmail: malloc failed\n"));
                return NULL;
        }
@@ -186,6 +187,8 @@ static int handle_plugin(const char *host,
                if (outlevel >= O_VERBOSE)
                    report(stderr, GT_("running %s (host %s service %s)\n"), plugin, host, service);
                argvec = parse_plugin(plugin,host,service);
+               if (argvec == NULL)
+                       _exit(EXIT_FAILURE);
                execvp(*argvec, argvec);
                report(stderr, GT_("execvp(%s) failed\n"), *argvec);
                _exit(EXIT_FAILURE);