Skip to content

Commit

Permalink
Replace t_malloc with t_malloc0 or t_malloc_no0
Browse files Browse the repository at this point in the history
Plain t_malloc was deprecated in dovecot.
  • Loading branch information
mrannanj authored and GitLab committed May 30, 2016
1 parent e2d6a03 commit 3d1226b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Expand Up @@ -69,7 +69,7 @@ static bool _regexp_compile
errsize = regerror(ret, regexp, NULL, 0);

if ( errsize > 0 ) {
char *errbuf = t_malloc(errsize);
char *errbuf = t_malloc0(errsize);

(void)regerror(ret, regexp, errbuf, errsize);

Expand Down
2 changes: 1 addition & 1 deletion src/lib-sieve/sieve-binary-file.c
Expand Up @@ -630,7 +630,7 @@ static bool _file_lazy_read
static const void *_file_lazy_load_data
(struct sieve_binary_file *file, off_t *offset, size_t size)
{
void *data = t_malloc(size);
void *data = t_malloc_no0(size);

if ( _file_lazy_read(file, offset, data, size) ) {
return data;
Expand Down
4 changes: 2 additions & 2 deletions src/lib-sieve/util/program-client-local.c
Expand Up @@ -149,8 +149,8 @@ static int program_client_local_connect

efds = array_get_modifiable(&pclient->extra_fds, &xfd_count);
if ( xfd_count > 0 ) {
parent_extra_fds = t_malloc(sizeof(int) * xfd_count);
child_extra_fds = t_malloc(sizeof(int) * xfd_count * 2 + 1);
parent_extra_fds = t_malloc0(sizeof(int) * xfd_count);
child_extra_fds = t_malloc0(sizeof(int) * xfd_count * 2 + 1);
for ( i = 0; i < xfd_count; i++ ) {
if ( pipe(extra_fd) < 0 ) {
i_error("pipe(extra=%d) failed: %m", extra_fd[1]);
Expand Down
2 changes: 1 addition & 1 deletion src/managesieve/managesieve-client.c
Expand Up @@ -200,7 +200,7 @@ static const char *client_stats(struct client *client)
struct var_expand_table *tab;
string_t *str;

tab = t_malloc(sizeof(static_tab));
tab = t_malloc_no0(sizeof(static_tab));
memcpy(tab, static_tab, sizeof(static_tab));

tab[0].value = dec2str(client->put_bytes);
Expand Down

0 comments on commit 3d1226b

Please sign in to comment.