mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-23 10:35:40 +08:00
Fix acl copy / auth copy out-of-memory error
This commit is contained in:
parent
c1c5875356
commit
dbbbe59ef2
@ -1038,11 +1038,13 @@ static void * itcopy (void * from, size_t size){
|
||||
struct auth * copyauth (struct auth * authfuncs){
|
||||
struct auth * newauth = NULL;
|
||||
|
||||
newauth = authfuncs = itcopy(authfuncs, sizeof(struct auth));
|
||||
for( ; authfuncs->next; authfuncs = authfuncs->next){
|
||||
newauth = itcopy(authfuncs, sizeof(struct auth));
|
||||
for( authfuncs=newauth; authfuncs; authfuncs = authfuncs->next){
|
||||
if(authfuncs->next){
|
||||
authfuncs->next = itcopy(authfuncs->next, sizeof(struct auth));
|
||||
if(!authfuncs->next)break;
|
||||
}
|
||||
}
|
||||
if(authfuncs){
|
||||
freeauth(newauth);
|
||||
return NULL;
|
||||
@ -1059,8 +1061,8 @@ struct ace * copyacl (struct ace *ac){
|
||||
struct period *pel;
|
||||
struct hostname *hst;
|
||||
|
||||
ret = ac = itcopy(ac, sizeof(struct ace));
|
||||
for( ; ac->next; ac = ac->next){
|
||||
ret = itcopy(ac, sizeof(struct ace));
|
||||
for( ac = ret; ac; ac = ac->next){
|
||||
if(ac->src){
|
||||
ac->src = itcopy(ac->src, sizeof(struct iplist));
|
||||
if(!ac->src) goto ERRORSRC;
|
||||
@ -1162,6 +1164,10 @@ struct ace * copyacl (struct ace *ac){
|
||||
}
|
||||
}
|
||||
}
|
||||
if(ac->next){
|
||||
ac->next = itcopy(ac->next, sizeof(struct ace));
|
||||
if(!ac->next) break;
|
||||
}
|
||||
}
|
||||
if(!ac) return ret;
|
||||
ERRORSRC:
|
||||
|
Loading…
Reference in New Issue
Block a user