]> de.git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/patch.c
q3map2: use safe_malloc0 when safe_malloc is followed by a memset to 0 with the same...
[xonotic/netradiant.git] / tools / quake3 / q3map2 / patch.c
index 82ff09a7e1498c225f82671f4318dfbf17f69fb1..95d478f647f3d5b0833bd8a2178aede53c5b40c0 100644 (file)
@@ -348,8 +348,7 @@ void ParsePatch( qboolean onlyLights ){
        }
 
        /* allocate patch mesh */
-       pm = safe_malloc( sizeof( *pm ) );
-       memset( pm, 0, sizeof( *pm ) );
+       pm = safe_malloc0( sizeof( *pm ) );
 
        /* ydnar: add entity/brush numbering */
        pm->entityNum = mapEnt->mapEntityNum;
@@ -445,8 +444,7 @@ void PatchMapDrawSurfs( entity_t *e ){
        if ( !patchCount ) {
                return;
        }
-       bordering = safe_malloc( patchCount * patchCount );
-       memset( bordering, 0, patchCount * patchCount );
+       bordering = safe_malloc0( patchCount * patchCount );
 
        // build the bordering matrix
        for ( k = 0 ; k < patchCount ; k++ ) {