projects
/
ust.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changes malloc to zmalloc
[ust.git]
/
ustd
/
ustd.c
diff --git
a/ustd/ustd.c
b/ustd/ustd.c
index 7637b40cf8d6685fc911f0f257bb47283b9259cc..c0f4c596eca0ce9a12165a1d090a3c655db0fcdf 100644
(file)
--- a/
ustd/ustd.c
+++ b/
ustd/ustd.c
@@
-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) {
/* 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");
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 =
int result;
int fd;
struct buffer_info_local *buf_local =
- malloc(sizeof(struct buffer_info_local));
+
z
malloc(sizeof(struct buffer_info_local));
if(!buf_local) {
ERR("could not allocate buffer_info_local struct");
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 =
struct libustd_callbacks *new_callbacks()
{
struct libustd_callbacks *callbacks =
- malloc(sizeof(struct libustd_callbacks));
+
z
malloc(sizeof(struct libustd_callbacks));
if(!callbacks)
return NULL;
if(!callbacks)
return NULL;
This page took
0.023381 seconds
and
4
git commands to generate.