title: Deallocation of Dynamic Arrays?
body: <p>Here's the code I am working with...</p>
  
  <pre><code>while(temp[i]!=0){
      while(temp[i]!=3){
          FrameBuffer[a]=temp[i];
          i++;
          a++;
      }
      FrameBuffer[a]=temp[i];
      printf(" Framebuffer: %s ", FrameBuffer);
      result=layer1(FrameBuffer,PacketAction);
      i++;
      a=0;
  }
  </code></pre>
  
  <p>The problem is that I want FrameBuffer to be reset each time it goes through the inner while loop (Size of FrameBuffer is 0 at start of loop). I've tried using free(FrameBuffer) but I get an error because I free the array more than once. I also tried writing FrameBuffer=NULL, but that did not work. Any help would be greatly appreciated. Thank you!</p>