* fish/rc.c (rc_remote): Close file handle only *after* xdr_destroy,
because that latter may flush its file handle (implicated via
xdrstdio_create). FYI, this failure is triggered for me only when
MALLOC_PERTURB_ is set to nonzero < 256 in my environment.
if (!xdr_guestfish_hello (&xdr, &hello)) {
fprintf (stderr, _("guestfish: protocol error: could not send initial greeting to server\n"));
- fclose (fp);
xdr_destroy (&xdr);
+ fclose (fp);
return -1;
}
call.exit_on_error = exit_on_error;
if (!xdr_guestfish_call (&xdr, &call)) {
fprintf (stderr, _("guestfish: protocol error: could not send initial greeting to server\n"));
- fclose (fp);
xdr_destroy (&xdr);
+ fclose (fp);
return -1;
}
xdr_destroy (&xdr);
if (!xdr_guestfish_reply (&xdr, &reply)) {
fprintf (stderr, _("guestfish: protocol error: could not decode reply from server\n"));
- fclose (fp);
xdr_destroy (&xdr);
+ fclose (fp);
return -1;
}
- fclose (fp);
xdr_destroy (&xdr);
+ fclose (fp);
return reply.r;
}