* (c) Copyright 1993, 1994 Sun Microsystems, Inc.
* (c) Copyright 1993, 1994 Novell, Inc.
*/
+#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
{
long i;
// compare all entries to a copy of the first entry
- strcpy(filebuf, &bufptr[long(vec[0])]);
+ snprintf(filebuf, sizeof(filebuf), "%s", &bufptr[long(vec[0])]);
for (i = 1; i < vec.size(); i++)
{
if ((strequal(directory, (XeString)"")) || (directory == NULL)){
if ((strequal(file, (XeString)"")) || (file == NULL)){
+ Xe_release_str(host);
return((XeString) NULL);
} else {
context_string = XeMalloc (strlen(host) + strlen(file) + 2);
if (is_dir_usable (dir))
return (dir);
+ free(dir);
return (NULL);
}
/* Get file descriptors for pipe */
if (pipe(wire_ptr->fd) < OK) {
SPC_Error(SPC_No_Pipe);
+ XeFree(wire_ptr);
return(SPC_ERROR);
}
return(wire_ptr);
}
}
- if(mempf0(channel, pre_fork)==SPC_ERROR)
- return(SPC_ERROR);
-
+ if(mempf0(channel, pre_fork)==SPC_ERROR) {
+ XeFree(dir);
+ return(SPC_ERROR);
+ }
+
/* When using HP NLIO (xj0input) we have a problem. Namely, */
/* the xj0 processs uses signal() to deal with SIGCLD which */
/* is incompatible with sigaction/sigprogmask/etc. Even */
sigemptyset(&oldsigmask);
sigaddset(&newsigmask, SIGCHLD);
- if (sigprocmask(SIG_BLOCK, &newsigmask, &oldsigmask) == ERROR)
- return(SPC_ERROR);
-
+ if (sigprocmask(SIG_BLOCK, &newsigmask, &oldsigmask) == ERROR) {
+ XeFree(dir);
+ return(SPC_ERROR);
+ }
+
pid = channel->pid = fork();
/*
memcpy(&saddr.sin_addr, remote->h_addr, remote->h_length);
if(connect(connection->sid, (struct sockaddr *)&saddr, sizeof(saddr)) == ERROR) {
- SPC_Error(SPC_Bad_Connect,
- XeFindShortHost(remote->h_name));
+ XeString shorthost = XeFindShortHost(remote->h_name);
+ SPC_Error(SPC_Bad_Connect, shorthost);
+ XeFree(shorthost);
+
return(SPC_ERROR);
}
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);
}
SET_INV_ERROR(invp->state);
SET_INV_CANCEL(invp->state);
+ close(fd);
return invp;
}
val, _DtACTION_ARG_MODE);
_DtSimpleError(DtProgName,DtError, NULL, "%s", buf);
free(val);
- buf = malloc(_DtAct_MAX_BUF_SIZE);
+ free(buf);
return NULL;
}
break; /* valid value */
sprintf (buf, missingName, _DtACTION_NAME, fileName);
_DtSimpleError(DtProgName,DtError, NULL, "%s", buf);
XtFree(fileName);
- if (buf) XtFree(buf);
+ XtFree(buf);
_DtSvcProcessUnlock();
return(True);
}
_DtActMMGetTtMsgInfo(DtDtsMMRecord *actRecp, ActionPtr actp)
{
char argNname[ sizeof(_DtACTION_TTN_ARG) /* space for prefix */
- + 3 /* enough space for three decimal digits */
+ + 9 /* enough space for three decimal digits */
+ sizeof(_DtACTION_TTN_REP_TYPE)]; /* space for longest suffix */
int i;
char *s;
if ( reqp )
SET_TOO_MANY_MAPS(reqp->mask);
_DtSvcProcessUnlock();
+ free(mapto);
return NULL;
}
}
buf = (void *)XtMalloc(bufLen + 1);
bytesRead = read(fd, buf, bufLen);
+ close(fd);
if (bytesRead == -1 || bytesRead != bufLen) {
XtFree((char *)buf);
extern int cde_dc_field_compare(DtDtsMMField **entry1, DtDtsMMField **entry2);
-_DtDtsClear()
+void
+_DtDtsClear(void)
{
_DtSvcProcessLock();
dtdts_path_pattern = 0;
static DtDtsDbDatabase **db_list;
static int num_db = 0;
+void
_DtDtsDbPrintFields(DtDtsDbRecord *rec_ptr, FILE *fd)
{
int fld;
}
}
+void
_DtDtsDbPrintRecords(DtDtsDbDatabase *db_ptr, FILE *fd)
{
int rec;
_DtSimpleError(
DtProgName, DtError, NULL,
(char*) tmpfile, NULL);
+ free(tmpfile);
return(0);
}
if (postDtEnvironmentString != postDtEnvironmentStringBuf)
{
- if (postDtEnvironmentString) XtFree(postDtEnvironmentString);
+ XtFree(postDtEnvironmentString);
postDtEnvironmentString = NULL;
}
{
_DtPrintDefaultErrorSafe(dpy, event, msg, BUFSIZ);
/* XXX retval? */
+
+ /* COV: 87468 nothing actually checks this return value */
+ return(1);
}
#define _DTP_STRNCAT(s1, s2, nb, ec) \
*
*****************************************************************************/
+#include <stdio.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/stat.h>
/*
* Create the display name and append it to the current path.
*/
- (void)strcpy(hostName, display->display_name);
- (void)strcpy(displayName, display->display_name);
+ snprintf(hostName, sizeof(hostName), "%s", display->display_name);
+ snprintf(displayName, sizeof(displayName), "%s", display->display_name);
/*
* If this is run to unix or local get the host name - otherwise