Fixed one instance of warning re. the use of tmpnam in gui-dialogs.c and removed small duplication of free() in readPNG.c
This commit is contained in:
parent
2989d8e6ea
commit
83da6a028d
@ -2705,6 +2705,7 @@ mo_status mo_edit_source(mo_window *win)
|
||||
{
|
||||
char *sourceFileName;
|
||||
FILE *fp;
|
||||
int fd;
|
||||
int length;
|
||||
char *editorName;
|
||||
char execString[1024];
|
||||
@ -2748,10 +2749,10 @@ extern void AddChildProcessHandler(int, void (*)(), void *);
|
||||
|
||||
/* write out source to tmp file with .html extension */
|
||||
sourceFileName = malloc(255);
|
||||
strcpy(sourceFileName, tmpnam(NULL));
|
||||
strcat(sourceFileName, ".html");
|
||||
strncpy(sourceFileName, "mosaic-XXXXXX.html\0", 19);
|
||||
fd = mkstemps(sourceFileName, 5);
|
||||
|
||||
if (!(fp = fopen(sourceFileName,"w")))
|
||||
if (!(fp = fdopen(fd, "w")))
|
||||
{
|
||||
char *buf, *final, tmpbuf[80];
|
||||
int final_len;
|
||||
|
@ -383,8 +383,6 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
q++; /* skip the alpha pixel */
|
||||
}
|
||||
}
|
||||
|
||||
free((char *)png_pixels);
|
||||
}
|
||||
else {
|
||||
|
||||
@ -400,11 +398,9 @@ ReadPNG(FILE *infile,int *width, int *height, XColor *colrs)
|
||||
*p++ = *q++; /*palette index*/
|
||||
}
|
||||
}
|
||||
|
||||
free((char *)png_pixels);
|
||||
|
||||
}
|
||||
|
||||
free((char *)png_pixels);
|
||||
free((png_byte **)row_pointers);
|
||||
|
||||
/* clean up after the read, and free any memory allocated */
|
||||
|
Loading…
Reference in New Issue
Block a user