* details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with these librararies and programs; if not, write
+ * License along with these libraries and programs; if not, write
* to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
* Floor, Boston, MA 02110-1301 USA
*/
#include <stdarg.h>
#include <sys/utsname.h>
#include <limits.h>
+#include <stdint.h>
#define X_INCLUDE_PWD_H
#define XOS_USE_XT_LOCKING
dptr->data[dptr->offset+dptr->len]=0;
fprintf(SPC_Print_Protocol,
- "%s channel: %x, request: %d, length: %d, seq: %d data: %s\n",
+ "%s channel: %p, request: %d, length: %d, seq: %d data: %s\n",
name, proto->channel, proto->request_type, dptr->len, proto->seqno,
dptr->data+dptr->offset);
/* We are overloading the "channel" field. We put the cid rather */
/* than the actual channel pointer in when we pass it to the other */
/* side of the connection. */
- prot_request->channel=(SPC_Channel_Ptr)(channel ? channel->cid : 0);
+ prot_request->channel=(SPC_Channel_Ptr) (intptr_t) (channel ? channel->cid : 0);
switch (request) {
envp=va_arg(ap, XeString *);
va_end(ap);
pdata->len=WRITE_APPLICATION_SPAWN(pdata, path, dir, argv, envp);
- if(pdata->len == SPC_ERROR)
+ if(pdata->len == SPC_ERROR) {
+ SPC_Free_Protocol_Ptr(prot_request);
return(SPC_ERROR);
+ }
prot_name=(XeString)" <-- APPLICATION_SPAWN";
break;
}
if(connection->protocol_version < 3) {
SPC_Error(SPC_Protocol_Version_Error,
3, channel->connection->protocol_version);
+ SPC_Free_Protocol_Ptr(prot_request);
return(SPC_ERROR);
}
if(connection->protocol_version < 3) {
SPC_Error(SPC_Protocol_Version_Error,
3, channel->connection->protocol_version);
+ SPC_Free_Protocol_Ptr(prot_request);
return(SPC_ERROR);
}
buffer = SPC_Decode_Termios(termios_ptr);
pdata->len=WRITE_TERMIOS(pdata, connector, side, buffer);
prot_name=(XeString)" <-- CHANNEL_TERMIOS";
+ free(buffer);
break;
}
if(connection->protocol_version < 3) {
SPC_Error(SPC_Protocol_Version_Error,
3, channel->connection->protocol_version);
+ SPC_Free_Protocol_Ptr(prot_request);
return(SPC_ERROR);
}
if(localprot)
SPC_Free_Protocol_Ptr(localprot);
prot=SPC_Filter_Connection(connection, NULL, request, TRUE);
- if(prot==SPC_ERROR)
- return(SPC_ERROR);
+ if(prot==SPC_ERROR) {
+ free(out);
+ return(SPC_ERROR);
+ }
print_protocol_request(name, prot);
localprot=prot;
bufptr=PDRP(prot->dataptr);
*envp=sscan_counted_string(bufptr, &bufptr);
if(*envp==SPC_ERROR)
return(SPC_ERROR);
+
+ return(TRUE);
}
/*----------------------------------------------------------------------+*/
READ_LOGFILE_REPLY(prot->dataptr, &channel->logfile, &junk1, &junk2);
if (junk1) XeFree(junk1);
- if (junk1) XeFree(junk2);
+ if (junk2) XeFree(junk2);
SPC_Free_Protocol_Ptr(prot);
return (TRUE);
tt_free (path);
XeFree(connection_hostname);
if (logfile) XeFree(logfile);
+ close(open_status);
return(SPC_ERROR);
}