You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by ma...@apache.org on 2008/02/19 19:23:35 UTC

svn commit: r629176 - /webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c

Author: manjula
Date: Tue Feb 19 10:23:26 2008
New Revision: 629176

URL: http://svn.apache.org/viewvc?rev=629176&view=rev
Log:
allocating len_array and buf_array dynamically.

Modified:
    webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c

Modified: webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c?rev=629176&r1=629175&r2=629176&view=diff
==============================================================================
--- webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c (original)
+++ webservices/axis2/trunk/c/axiom/src/attachments/mime_parser.c Tue Feb 19 10:23:26 2008
@@ -115,8 +115,9 @@
     int buf_num = 0;    
     int buf_len = 0;
     axis2_callback_info_t *cb_ctx = NULL;
-    axis2_char_t *buf_array[mime_parser->max_chunk_buffers];
-    int len_array[mime_parser->max_chunk_buffers];
+    axis2_char_t **buf_array = NULL;
+    int *len_array = NULL;
+
 
     cb_ctx = (axis2_callback_info_t *) callback_ctx;
 
@@ -124,6 +125,12 @@
 
     if(cb_ctx->chunked_stream)
     {
+        buf_array = AXIS2_MALLOC(env->allocator, sizeof(axis2_char_t *) * (
+                       mime_parser->max_chunk_buffers));
+
+        len_array = AXIS2_MALLOC(env->allocator, sizeof(int) * (
+                       mime_parser->max_chunk_buffers));
+
         size = (mime_parser->chunk_buffer_size) * AXIOM_MIME_PARSER_BUFFER_SIZE;
 
 
@@ -403,6 +410,18 @@
             body_mime = temp_body_mime;
         }
     }                           /* end while (!end_of_mime) */
+
+    if(buf_array)
+    {
+        AXIS2_FREE(env->allocator, buf_array);
+        buf_array = NULL;
+    }
+
+    if(len_array)
+    {
+        AXIS2_FREE(env->allocator, len_array);
+        len_array = NULL;
+    }
 
     AXIS2_FREE(env->allocator, buffer);
 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org