diff options
| author | David M. Syzdek <david@syzdek.net> | 2019-11-30 03:12:30 -0900 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2019-11-30 03:12:30 -0900 |
| commit | 8401f63b379ae5227063d2c6a41ea3ce2f15d882 (patch) | |
| tree | 8451bae72467c33065f93df756c147a212233bd9 | |
| parent | 4d2fd107df0a55c7647b7684b339dd0064c8237e (diff) | |
| download | ldap-utils-8401f63b379ae5227063d2c6a41ea3ce2f15d882.tar.gz ldap-utils-8401f63b379ae5227063d2c6a41ea3ce2f15d882.tar.bz2 ldap-utils-8401f63b379ae5227063d2c6a41ea3ce2f15d882.tar.xz ldap-utils-8401f63b379ae5227063d2c6a41ea3ce2f15d882.zip | |
libldapschema: fixing allocation sizes in ldapschema_model_register()
| -rw-r--r-- | lib/libldapschema/lmemory.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libldapschema/lmemory.c b/lib/libldapschema/lmemory.c index b397661..b610b79 100644 --- a/lib/libldapschema/lmemory.c +++ b/lib/libldapschema/lmemory.c | |||
| @@ -582,7 +582,7 @@ int ldapschema_model_register(LDAPSchema * lsd, LDAPSchemaModel * mod) | |||
| 582 | }; | 582 | }; |
| 583 | 583 | ||
| 584 | // adds model into model specific list using OID | 584 | // adds model into model specific list using OID |
| 585 | if ((alias = malloc(sizeof(LDAPSchemaAlias *))) == NULL) | 585 | if ((alias = malloc(sizeof(LDAPSchemaAlias))) == NULL) |
| 586 | return(lsd->errcode = LDAPSCHEMA_NO_MEMORY); | 586 | return(lsd->errcode = LDAPSCHEMA_NO_MEMORY); |
| 587 | alias->alias = mod->oid; | 587 | alias->alias = mod->oid; |
| 588 | alias->model = mod; | 588 | alias->model = mod; |
| @@ -600,7 +600,7 @@ int ldapschema_model_register(LDAPSchema * lsd, LDAPSchemaModel * mod) | |||
| 600 | // adds model into model specific list using desc | 600 | // adds model into model specific list using desc |
| 601 | if ((desc)) | 601 | if ((desc)) |
| 602 | { | 602 | { |
| 603 | if ((alias = malloc(sizeof(LDAPSchemaAlias *))) == NULL) | 603 | if ((alias = malloc(sizeof(LDAPSchemaAlias))) == NULL) |
| 604 | return(lsd->errcode = LDAPSCHEMA_NO_MEMORY); | 604 | return(lsd->errcode = LDAPSCHEMA_NO_MEMORY); |
| 605 | alias->alias = desc; | 605 | alias->alias = desc; |
| 606 | alias->model = mod; | 606 | alias->model = mod; |
| @@ -619,7 +619,7 @@ int ldapschema_model_register(LDAPSchema * lsd, LDAPSchemaModel * mod) | |||
| 619 | // adds model into model specific list using names | 619 | // adds model into model specific list using names |
| 620 | for(idx = 0; (idx < names_len); idx++) | 620 | for(idx = 0; (idx < names_len); idx++) |
| 621 | { | 621 | { |
| 622 | if ((alias = malloc(sizeof(LDAPSchemaAlias *))) == NULL) | 622 | if ((alias = malloc(sizeof(LDAPSchemaAlias))) == NULL) |
| 623 | return(lsd->errcode = LDAPSCHEMA_NO_MEMORY); | 623 | return(lsd->errcode = LDAPSCHEMA_NO_MEMORY); |
| 624 | alias->alias = names[idx]; | 624 | alias->alias = names[idx]; |
| 625 | alias->model = mod; | 625 | alias->model = mod; |
