Fix V773 warning from PVS-Studio Static Analyzer
The function was exited without releasing a pointer. A memory leak is possible.
This commit is contained in:
parent
f9bf041b50
commit
5cdbcc3dd2
|
@ -1654,8 +1654,10 @@ domailuser (char *username)
|
||||||
DGL_MAILMSGLEN);
|
DGL_MAILMSGLEN);
|
||||||
mvaddstr (7, 1, "=> ");
|
mvaddstr (7, 1, "=> ");
|
||||||
|
|
||||||
if (mygetnstr (message, DGL_MAILMSGLEN, 1) != OK)
|
if (mygetnstr (message, DGL_MAILMSGLEN, 1) != OK) {
|
||||||
|
if (spool_fn) free(spool_fn);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0; i < strlen (message); i++)
|
for (i = 0; i < strlen (message); i++)
|
||||||
{
|
{
|
||||||
|
@ -2558,6 +2560,7 @@ purge_stale_locks (int game)
|
||||||
{
|
{
|
||||||
nocbreak(); /* leave half-delay */
|
nocbreak(); /* leave half-delay */
|
||||||
cbreak();
|
cbreak();
|
||||||
|
if (fn) free(fn);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
mvprintw (3, 50 + strlen(myconfig[game]->game_name), "%d%s", seconds, (seconds > 9) ? "" : " ");
|
mvprintw (3, 50 + strlen(myconfig[game]->game_name), "%d%s", seconds, (seconds > 9) ? "" : " ");
|
||||||
|
|
|
@ -223,7 +223,11 @@ dgl_exec_cmdqueue(struct dg_cmdpart *queue, int game, struct dg_user *me)
|
||||||
p1 = (char *)malloc(1024);
|
p1 = (char *)malloc(1024);
|
||||||
p2 = (char *)malloc(1024);
|
p2 = (char *)malloc(1024);
|
||||||
|
|
||||||
if (!p1 || !p2) return 1;
|
if (!p1 || !p2) {
|
||||||
|
if (p1) free(p1);
|
||||||
|
if (p2) free(p2);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
return_from_submenu = 0;
|
return_from_submenu = 0;
|
||||||
|
|
||||||
|
@ -635,6 +639,8 @@ populate_games (int xgame, int *l, struct dg_user *me)
|
||||||
debug_write("cannot open inprogress-dir");
|
debug_write("cannot open inprogress-dir");
|
||||||
graceful_exit (140);
|
graceful_exit (140);
|
||||||
}
|
}
|
||||||
|
free(dir);
|
||||||
|
dir = NULL;
|
||||||
|
|
||||||
while ((pdirent = readdir (pdir)))
|
while ((pdirent = readdir (pdir)))
|
||||||
{
|
{
|
||||||
|
|
4
ee.c
4
ee.c
|
@ -2101,8 +2101,10 @@ int noverify;
|
||||||
ans = get_string(changes_made_prompt, TRUE);
|
ans = get_string(changes_made_prompt, TRUE);
|
||||||
if (toupper(*ans) == toupper(*yes_char))
|
if (toupper(*ans) == toupper(*yes_char))
|
||||||
text_changes = FALSE;
|
text_changes = FALSE;
|
||||||
else
|
else {
|
||||||
|
free(ans);
|
||||||
return(0);
|
return(0);
|
||||||
|
}
|
||||||
free(ans);
|
free(ans);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue