Multi-target: NEWS and user manual
[deliverable/binutils-gdb.git] / libiberty / pexecute.c
index 60a280b8e472931106d9d8bf7f800bdf17851872..b951d908b2e855923d3708cf1db4a7536c369b3d 100644 (file)
@@ -1,6 +1,6 @@
 /* Utilities to execute a program in a subprocess (possibly linked by pipes
    with other subprocesses), and wait for it.
-   Copyright (C) 2004 Free Software Foundation, Inc.
+   Copyright (C) 2004-2019 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
@@ -47,7 +47,7 @@ pexecute (const char *program, char * const *argv, const char *pname,
     {
       if (pex != NULL)
        {
-         *errmsg_fmt = "pexecute already in progress";
+         *errmsg_fmt = (char *) "pexecute already in progress";
          *errmsg_arg = NULL;
          return -1;
        }
@@ -58,7 +58,7 @@ pexecute (const char *program, char * const *argv, const char *pname,
     {
       if (pex == NULL)
        {
-         *errmsg_fmt = "pexecute not in progress";
+         *errmsg_fmt = (char *) "pexecute not in progress";
          *errmsg_arg = NULL;
          return -1;
        }
@@ -101,7 +101,10 @@ pwait (int pid, int *status, int flags ATTRIBUTE_UNUSED)
 
       vector = XNEWVEC (int, idx);
       if (!pex_get_status (pex, idx, vector))
-       return -1;
+       {
+         free (vector);
+         return -1;
+       }
       *status = vector[pid];
       free (vector);
     }
This page took 0.03443 seconds and 4 git commands to generate.