Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.33 KB | None | 0 0
  1. int main()
  2. {
  3.     void *app_data;
  4.     void *tmp_data;
  5.     int i;
  6.    
  7.     app_data = malloc(1000);
  8.     i = 0;
  9.    
  10.     while (i < 1717)
  11.     {
  12.         tmp_data = malloc(100);
  13.         process_data(tmp_data);
  14.         free(tmp_data); // meaningful free ! we'd grow at each iteration otherwise
  15.     }
  16.    
  17.     free(app_data) // useless : we're exiting immediatly afterwards
  18.     return 0;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement