From: steudten Date: Thu, 20 Sep 2001 13:30:08 +0000 (+0000) Subject: Make freez() more secure in case of: if (exp) { free(z) ; a=*z } X-Git-Tag: v_2_9_9~61 X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=commitdiff_plain;h=80a41b0490ed0e6e36427cabcb597449bbfa3686 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.. --- 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