(mu_auth_data_alloc): Fill auth object with zeroes.
(mu_auth_data_set_quota): New function
Showing
1 changed file
with
10 additions
and
2 deletions
... | @@ -79,7 +79,7 @@ mu_auth_data_alloc (struct mu_auth_data **ptr, | ... | @@ -79,7 +79,7 @@ mu_auth_data_alloc (struct mu_auth_data **ptr, |
79 | strlen (mailbox) + 1; | 79 | strlen (mailbox) + 1; |
80 | char *p; | 80 | char *p; |
81 | 81 | ||
82 | *ptr = malloc (size); | 82 | *ptr = calloc (1, size); |
83 | if (!*ptr) | 83 | if (!*ptr) |
84 | return ENOMEM; | 84 | return ENOMEM; |
85 | 85 | ||
... | @@ -103,6 +103,13 @@ mu_auth_data_alloc (struct mu_auth_data **ptr, | ... | @@ -103,6 +103,13 @@ mu_auth_data_alloc (struct mu_auth_data **ptr, |
103 | } | 103 | } |
104 | 104 | ||
105 | void | 105 | void |
106 | mu_auth_data_set_quota (struct mu_auth_data *ptr, mu_off_t q) | ||
107 | { | ||
108 | ptr->flags |= MU_AF_QUOTA; | ||
109 | ptr->quota = q; | ||
110 | } | ||
111 | |||
112 | void | ||
106 | mu_auth_data_free (struct mu_auth_data *ptr) | 113 | mu_auth_data_free (struct mu_auth_data *ptr) |
107 | { | 114 | { |
108 | free (ptr); | 115 | free (ptr); |
... | @@ -182,7 +189,8 @@ static mu_list_t mu_auth_by_name_list, _tmp_auth_by_name_list; | ... | @@ -182,7 +189,8 @@ static mu_list_t mu_auth_by_name_list, _tmp_auth_by_name_list; |
182 | static mu_list_t mu_auth_by_uid_list, _tmp_auth_by_uid_list; | 189 | static mu_list_t mu_auth_by_uid_list, _tmp_auth_by_uid_list; |
183 | 190 | ||
184 | int | 191 | int |
185 | mu_get_auth (struct mu_auth_data **auth, enum mu_auth_key_type type, const void *key) | 192 | mu_get_auth (struct mu_auth_data **auth, enum mu_auth_key_type type, |
193 | const void *key) | ||
186 | { | 194 | { |
187 | mu_list_t list; | 195 | mu_list_t list; |
188 | 196 | ... | ... |
-
Please register or sign in to post a comment