Commit bee8886408a82c244956b76db4ab7b79cdca9079

Alexei Podtelezhnikov 2022-01-30T21:55:21

Clean-up - do not doubt FT_FREE. * src/base/ftobjs.c (memory_stream_close): Do not reassign zero after `FT_FREE`. * src/sfnt/sfwoff.c (sfnt_stream_close): Ditto. * src/sfnt/sfwoff2.c (stream_close): Ditto. * src/psaux/psobjs.c (ps_parser_load_field): Ditto. * src/truetype/ttgxvar.c (ft_var_load_avar, tt_set_mm_blend, tt_set_mm_blend): Ditto.

diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index d265e74..2c0f0e6 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -1674,7 +1674,6 @@
     FT_FREE( stream->base );
 
     stream->size  = 0;
-    stream->base  = NULL;
     stream->close = NULL;
   }
 
diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c
index 6871eb7..212a657 100644
--- a/src/psaux/psobjs.c
+++ b/src/psaux/psobjs.c
@@ -1188,7 +1188,6 @@
             FT_TRACE0(( "ps_parser_load_field: overwriting field %s\n",
                         field->ident ));
             FT_FREE( *(FT_String**)q );
-            *(FT_String**)q = NULL;
           }
 
           if ( FT_QALLOC( string, len + 1 ) )
diff --git a/src/sfnt/sfwoff.c b/src/sfnt/sfwoff.c
index 68609a7..0e8ec3f 100644
--- a/src/sfnt/sfwoff.c
+++ b/src/sfnt/sfwoff.c
@@ -64,7 +64,6 @@
     FT_FREE( stream->base );
 
     stream->size  = 0;
-    stream->base  = NULL;
     stream->close = NULL;
   }
 
diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c
index f1f2eef..cb1e066 100644
--- a/src/sfnt/sfwoff2.c
+++ b/src/sfnt/sfwoff2.c
@@ -94,7 +94,6 @@
     FT_FREE( stream->base );
 
     stream->size  = 0;
-    stream->base  = NULL;
     stream->close = NULL;
   }
 
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 2a7f917..6a0edef 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -415,7 +415,6 @@
           FT_FREE( blend->avar_segment[j].correspondence );
 
         FT_FREE( blend->avar_segment );
-        blend->avar_segment = NULL;
         goto Exit;
       }
 
@@ -2747,7 +2746,6 @@
         /* The cvt table has been loaded already; every time we change the */
         /* blend we may need to reload and remodify the cvt table.         */
         FT_FREE( face->cvt );
-        face->cvt = NULL;
 
         error = tt_face_load_cvt( face, face->root.stream );
         break;
@@ -2766,7 +2764,6 @@
 
     /* enforce recomputation of the PostScript name; */
     FT_FREE( face->postscript_name );
-    face->postscript_name = NULL;
 
   Exit:
     return error;