1
0
mirror of https://github.com/rfivet/uemacs.git synced 2025-09-27 07:24:08 -04:00

Fix newly reported coverity issues (Memory leak and flase positive of Use after Free).

This commit is contained in:
2017-05-27 16:07:56 +08:00
parent 5368877ebb
commit 5d46ffc3dc
2 changed files with 7 additions and 3 deletions

8
exec.c
View File

@@ -712,6 +712,7 @@ static int dobuf(struct buffer *bp)
c = mdbugout( "<<<%s:%d:%s>>>", bp->b_bname, execlevel, eline) ;
if( c == abortc) {
freewhile( whlist) ;
free( einit) ;
return FALSE ;
} else if( c == metac) {
macbug = FALSE ;
@@ -733,6 +734,7 @@ static int dobuf(struct buffer *bp)
if (dirnum == NUMDIRS) {
mlwrite("%%Unknown Directive");
freewhile(whlist);
free( einit) ;
return FALSE;
}
@@ -752,9 +754,9 @@ static int dobuf(struct buffer *bp)
/* allocate the space for the line */
linlen = strlen(eline);
if ((mp = lalloc(linlen)) == NULL) {
mlwrite
("Out of memory while storing macro");
return FALSE;
free( einit) ;
mlwrite( "Out of memory while storing macro") ;
return FALSE ;
}
/* copy the text into the new line */