]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
tweak
authorAnthony Minessale <anthony.minessale@gmail.com>
Sat, 6 Jan 2007 16:40:46 +0000 (16:40 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Sat, 6 Jan 2007 16:40:46 +0000 (16:40 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@3916 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_console.c

index be11823b0431168c9b696825bc0c8b64784c56b5..4f6805f8c6aadc148a4dc41b9ca6777718497b8b 100644 (file)
@@ -64,16 +64,13 @@ SWITCH_DECLARE(switch_status_t) switch_console_stream_write(switch_stream_handle
                
                if ((remaining < need) && handle->alloc_len) {
                        switch_size_t new_len;
-                       
-                       if (need < handle->alloc_chunk) {
-                               need = handle->alloc_chunk;
-                       }
+                       void *new_data;
 
-                       new_len = handle->data_size + need;
-                       if ((handle->data = realloc(handle->data, new_len))) {
+                       new_len = handle->data_size + need + handle->alloc_chunk;
+                       if ((new_data = realloc(handle->data, new_len))) {
                                handle->data_size = handle->alloc_len = new_len;
+                handle->data = new_data;
                                buf = handle->data;
-
                                remaining = handle->data_size - handle->data_len;
                                handle->end = (uint8_t *)(handle->data) + handle->data_len;
                                end = handle->end;