Coverity CID 1758: Unconfuse coverity about memory leak.

This commit is contained in:
christos 2006-03-26 22:02:59 +00:00
parent 0c9571be10
commit 4820f3f28c
1 changed files with 5 additions and 3 deletions

8
dist/cdk/cdk.c vendored
View File

@ -1,9 +1,9 @@
#include <cdk.h> #include <cdk.h>
/* /*
* $Author: wiz $ * $Author: christos $
* $Date: 2004/04/05 10:21:23 $ * $Date: 2006/03/26 22:02:59 $
* $Revision: 1.3 $ * $Revision: 1.4 $
*/ */
char *GPasteBuffer = 0; char *GPasteBuffer = 0;
@ -371,6 +371,8 @@ chtype *char2Chtype (char *string, int *to, int *align)
{ {
if (pass != 0) if (pass != 0)
{ {
if (result)
free(result);
if ((result = (chtype *)malloc((used+2) * sizeof(chtype))) == 0) if ((result = (chtype *)malloc((used+2) * sizeof(chtype))) == 0)
{ {
used = 0; used = 0;