From 80a41b0490ed0e6e36427cabcb597449bbfa3686 Mon Sep 17 00:00:00 2001 From: steudten Date: Thu, 20 Sep 2001 13:30:08 +0000 Subject: [PATCH] Make freez() more secure in case of: if (exp) { free(z) ; a=*z } Last case will set z to NULL in free(z) and thats bad.. --- project.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/project.h b/project.h index a6c5315b..ff5b8fa3 100644 --- a/project.h +++ b/project.h @@ -1,6 +1,6 @@ #ifndef PROJECT_H_INCLUDED #define PROJECT_H_INCLUDED -#define PROJECT_H_VERSION "$Id: project.h,v 1.31 2001/09/16 13:20:29 jongfoster Exp $" +#define PROJECT_H_VERSION "$Id: project.h,v 1.32 2001/09/16 23:02:51 jongfoster Exp $" /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/project.h,v $ @@ -36,6 +36,9 @@ * * Revisions : * $Log: project.h,v $ + * Revision 1.32 2001/09/16 23:02:51 jongfoster + * Fixing warning + * * Revision 1.31 2001/09/16 13:20:29 jongfoster * Rewrite of list library. Now has seperate header and list_entry * structures. Also added a large sprinking of assert()s to the list @@ -304,7 +307,7 @@ extern "C" { #endif -#define freez(X) if(X) free(X); X = NULL +#define freez(X) { if(X) { free(X); X = NULL ; } } #define BUFFER_SIZE 5000 -- 2.39.2