lra: fix spill_hard_reg_in_range clobber check
[gcc.git] / libiberty / pexecute.c
index cce6e300c5d5bd14b8c8ca2ef3bc4b5a3139df92..5a8e4eeeb944625424fc8316b442e630480b9481 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-2018 Free Software Foundation, Inc.
 
 This file is part of the libiberty library.
 Libiberty is free software; you can redistribute it and/or
@@ -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);
     }