Coverity: Don't return freed pointers from command* along error path.
authorRichard W.M. Jones <rjones@redhat.com>
Thu, 9 Jun 2011 08:39:54 +0000 (09:39 +0100)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 13 Jun 2011 13:22:31 +0000 (14:22 +0100)
commit86ef0210523a585a4c856859d36f7f888aa6fa5d
treeb7fbfed726f9413219a1ce327ec41ce8e9ba469f
parent6399b416ad79fb2727cf1054b64032d401019b0d
Coverity: Don't return freed pointers from command* along error path.

If the external command failed to run, we could free up the allocated
*stdoutput and *stderror pointers, but then return those freed
pointers to the caller.  The caller usually tries to print and free
*stderror, so this is a serious error.

Instead, return *stdoutput as NULL, and *stderror pointing to a
generic error message.
(cherry picked from commit 29453a58d818df24c238d0a08a68886ebe4029dd)
daemon/guestfsd.c