Yes, we do want to free the buf, and the space too if it is still
there.
while (update_queue_handled) {
struct metadata_update *this = update_queue_handled;
update_queue_handled = this->next;
-// free(this->buf);
+ free(this->buf);
+ if (this->space)
+ free(this->space);
free(this);
}
if (update_queue == NULL &&
* Create a metadata_update record to update the
* phys_refnum and lba_offset values
*/
- mu = malloc(sizeof(*mu) + ddf->conf_rec_len * 512);
- mu->buf = (char*)(mu+1);
+ mu = malloc(sizeof(*mu));
+ mu->buf = malloc(ddf->conf_rec_len * 512);
mu->space = malloc(sizeof(struct vcl));
mu->len = ddf->conf_rec_len;
mu->next = *updates;