summaryrefslogtreecommitdiff
path: root/source/lib/sysacls.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/lib/sysacls.c')
-rw-r--r--source/lib/sysacls.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/source/lib/sysacls.c b/source/lib/sysacls.c
index e7bd288f6e8..61975264fd6 100644
--- a/source/lib/sysacls.c
+++ b/source/lib/sysacls.c
@@ -689,12 +689,8 @@ char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p)
* for each entry still to be processed
*/
if ((len + nbytes) > maxlen) {
- char *oldtext = text;
-
maxlen += nbytes + 20 * (acl_d->count - i);
-
- if ((text = SMB_REALLOC(oldtext, maxlen)) == NULL) {
- SAFE_FREE(oldtext);
+ if ((text = SMB_REALLOC(text, maxlen)) == NULL) {
errno = ENOMEM;
return NULL;
}
@@ -1320,11 +1316,8 @@ char *sys_acl_to_text(SMB_ACL_T acl_d, ssize_t *len_p)
* for each entry still to be processed
*/
if ((len + nbytes) > maxlen) {
- char *oldtext = text;
-
maxlen += nbytes + 20 * (acl_d->count - i);
-
- if ((text = SMB_REALLOC(oldtext, maxlen)) == NULL) {
+ if ((text = SMB_REALLOC(text, maxlen)) == NULL) {
free(oldtext);
errno = ENOMEM;
return NULL;