diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-02 12:37:57 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-01-02 12:37:57 +0000 |
commit | bcf0a969366924506094c8aeb2651d7886483cf4 (patch) | |
tree | 420752ccf468531bad771735fb6c6cf3d247128b /src/libutil/fstring.c | |
parent | f47ab50fd547cb45b3e678673d5dbfebaffddb8b (diff) | |
download | rspamd-bcf0a969366924506094c8aeb2651d7886483cf4.tar.gz rspamd-bcf0a969366924506094c8aeb2651d7886483cf4.zip |
[Minor] Fix posix_memalign -> malloc transition
Diffstat (limited to 'src/libutil/fstring.c')
-rw-r--r-- | src/libutil/fstring.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libutil/fstring.c b/src/libutil/fstring.c index 88beaf570..15cbb41be 100644 --- a/src/libutil/fstring.c +++ b/src/libutil/fstring.c @@ -25,7 +25,7 @@ rspamd_fstring_new (void) { rspamd_fstring_t *s; - if ((s = malloc (default_initial_size + sizeof (*s))) != 0) { + if ((s = malloc (default_initial_size + sizeof (*s))) == NULL) { g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes", G_STRLOC, default_initial_size + sizeof (*s)); @@ -44,7 +44,7 @@ rspamd_fstring_sized_new (gsize initial_size) rspamd_fstring_t *s; gsize real_size = MAX (default_initial_size, initial_size); - if ((s = malloc (real_size + sizeof (*s))) != 0) { + if ((s = malloc (real_size + sizeof (*s))) == NULL) { g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes", G_STRLOC, real_size + sizeof (*s)); @@ -62,7 +62,7 @@ rspamd_fstring_new_init (const gchar *init, gsize len) rspamd_fstring_t *s; gsize real_size = MAX (default_initial_size, len); - if ((s = malloc (real_size + sizeof (*s))) != 0) { + if ((s = malloc (real_size + sizeof (*s))) == NULL) { g_error ("%s: failed to allocate %"G_GSIZE_FORMAT" bytes", G_STRLOC, real_size + sizeof (*s)); |