X-Git-Url: http://git.lttng.org/?p=ust.git;a=blobdiff_plain;f=ustd%2Fustd.c;h=c0f4c596eca0ce9a12165a1d090a3c655db0fcdf;hp=18dbf6377a5488dbc0d3f322c7f0663791f1d81f;hb=7032c7d350bfa093db533713df8a14df37360bdc;hpb=5f9aacae75a4181a54bf16f31ce8e18229dddc60 diff --git a/ustd/ustd.c b/ustd/ustd.c index 18dbf63..c0f4c59 100644 --- a/ustd/ustd.c +++ b/ustd/ustd.c @@ -32,7 +32,7 @@ #include #include -#include "libustd.h" +#include "ust/ustd.h" #include "usterr.h" char *sock_path=NULL; @@ -150,8 +150,7 @@ int on_read_partial_subbuffer(struct libustd_callbacks *data, struct buffer_info /* pad with empty bytes */ pad_size = PAGE_ALIGN(valid_length)-valid_length; if(pad_size) { - tmp = malloc(pad_size); - memset(tmp, 0, pad_size); + tmp = zmalloc(pad_size); result = patient_write(buf_local->file_fd, tmp, pad_size); if(result == -1) { ERR("Error writing to buffer file"); @@ -168,7 +167,7 @@ int on_open_buffer(struct libustd_callbacks *data, struct buffer_info *buf) int result; int fd; struct buffer_info_local *buf_local = - malloc(sizeof(struct buffer_info_local)); + zmalloc(sizeof(struct buffer_info_local)); if(!buf_local) { ERR("could not allocate buffer_info_local struct"); @@ -233,7 +232,7 @@ int on_put_error(struct libustd_callbacks *data, struct buffer_info *buf) struct libustd_callbacks *new_callbacks() { struct libustd_callbacks *callbacks = - malloc(sizeof(struct libustd_callbacks)); + zmalloc(sizeof(struct libustd_callbacks)); if(!callbacks) return NULL;