]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
osx_write.c: Use realloc() instead of free() and malloc()
authorAndre Noll <maan@congo.fml.local>
Wed, 23 Aug 2006 10:26:18 +0000 (12:26 +0200)
committerAndre Noll <maan@congo.fml.local>
Wed, 23 Aug 2006 10:26:18 +0000 (12:26 +0200)
Also, kill a silly comment.

osx_write.c

index 885c05d1a535a0b3b4eb65e894bd73e2d5d038bb..39af500077a939a28109e7535868560487f63b1d 100644 (file)
@@ -105,12 +105,7 @@ static void fill_buffer(osx_buffer *b, short *source, long size)
                return;
        PARA_INFO_LOG("%ld\n", size);
        if (b->size != size) {
                return;
        PARA_INFO_LOG("%ld\n", size);
        if (b->size != size) {
-               /*
-                * Hey! What's that? Coudn't this buffer size be fixed
-                * once (well, perhaps we just didn't allocate it yet)
-                */
-               free(b->buffer);
-               b->buffer = malloc(size * sizeof(float));
+               b->buffer = para_realloc(b->buffer, size * sizeof(float));
                b->size = size;
        }
        dest = b->buffer;
                b->size = size;
        }
        dest = b->buffer;