Revision 4626022b src/CloudSupport/libs3_delegate_helper.c

View differences:

src/CloudSupport/libs3_delegate_helper.c
167 167
  free(req);
168 168
}
169 169

  
170
static void free_response(libs3_get_response_t *rsp) {
171
  if (rsp->data) free(rsp->data);
172

  
173
  free(rsp);
174
}
175

  
170 176
/************************************************************************
171 177
 * libs3 callback implementation
172 178
 ************************************************************************/
......
621 627
    } else {
622 628
      /* there was some error with the request */
623 629
      req_handler_remove_response(ctx->req_handler);
630
      free_response(rsp);
624 631
      return -1;
625 632
    }
626 633
  } else {
......
649 656

  
650 657
  if (rsp->read_bytes == rsp->data_length){
651 658
    req_handler_remove_response(ctx->req_handler);
659
    free_response(rsp);
652 660
  }
653 661

  
654 662
  return toread;

Also available in: Unified diff