if ( (status = system(printCommand))!= 0)
{
unlink(tmpfile);
+ free(tmpfile);
return status; /* RETURN */
}
{
strcpy(pCharset, charset);
mb_free(&charset);
+ free(charset);
}
else
strcpy(pCharset, isoString);
int pathleng;
int fileleng;
SEARCH *thispath;
-char *mb_inputname;
+char *mb_inputname = NULL;
M_WCHAR *wc_try, *wc_outputname;
int tossfile;
char filebuf[BIGBUF];
}
if (try != pathbuf) mb_free(&try);
+
+mb_free(&mb_inputname);
}
/* Below is a modified version of m_cyclent() that returns a pointer
tex = fopen(helpbase, "w");
fprintf(tex, "\\gobble\001%s\002%%\n", m_signon);
fputs("% Generated Cross-Reference Macros (for a particular document)\n", tex);
+fclose(tex);
if (! xtree.data) return;
n = 0;
void srefout(M_NOPAR)
{
LOGICAL first = TRUE ;
- int *mapbysref ;
+ int *mapbysref = NULL;
SREFSTRUCT *srefp ;
SREFDATA *data ;
int count = 0 ;
fputs(ndif, dtd) ;
}
SUBONE
+ free(mapbysref);
}
/* Output one element block in a template */
if (! newtransit || (loading && ! newdlm))
{
trysize = NUMDELIM + 1;
+ free(newtransit);
newtransit = (int *) calloc(NUMCON * trysize, sizeof(int));
- if (loading) newdlm = (char **) calloc(trysize, sizeof(M_WCHAR *));
+ if (loading) { free(newdlm); newdlm = (char **) calloc(trysize, sizeof(M_WCHAR *)); }
}
if (! newtransit || (loading && ! newdlm))
{
ret = system(pcmd);
ret = snprintf(pcmd, slen, "touch %s",pfile2);
ret = system(pcmd);
+ free(pcmd);
}
int nextchar(file, data)
fprintf(stderr, "**** Specify interface file ****\n") ;
exit(TRUE) ;
}
- strncpy(iffile, argv[1], IFLEN) ;
+ strncpy(iffile, argv[1], IFLEN - 1) ;
initialize() ;
while (TRUE) {
m_token = scan() ;
* the amount of padding needed in between the vstruct and the first
* virpage to make everything work
*/
-static int CompressVstruct()
+static void CompressVstruct()
{
#define COMPRESS_PAD_LENGTH 10
char buffer[BUFSIZ], zTemp[4];
int nameindex ;
LOGICAL start ;
- strncpy(efilename, fname, ENTFILENAME) ;
- strncpy(&efilename[strlen(efilename)], ".h", 2) ;
+ snprintf(efilename, sizeof(efilename), "%s.h", fname);
m_openchk(&entfile, efilename, "w") ;
fprintf(entfile, "#include \"entdef.h\"\n") ;