diff options
Diffstat (limited to 'lib/libldapschema/lmemory.c')
| -rw-r--r-- | lib/libldapschema/lmemory.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/libldapschema/lmemory.c b/lib/libldapschema/lmemory.c index c875d6e..052de6d 100644 --- a/lib/libldapschema/lmemory.c +++ b/lib/libldapschema/lmemory.c | |||
| @@ -768,6 +768,30 @@ void * ldapschema_oid(LDAPSchema * lsd, const char * oid, uint32_t type) | |||
| 768 | } | 768 | } |
| 769 | 769 | ||
| 770 | 770 | ||
| 771 | char * ldapschema_stradd(char ** s1p, const char * s2) | ||
| 772 | { | ||
| 773 | char * s1; | ||
| 774 | size_t l1; | ||
| 775 | size_t l2; | ||
| 776 | void * ptr; | ||
| 777 | |||
| 778 | assert(s1p != NULL); | ||
| 779 | assert(*s1p != NULL); | ||
| 780 | assert(s2 != NULL); | ||
| 781 | |||
| 782 | s1 = *s1p; | ||
| 783 | l1 = strlen(s1); | ||
| 784 | l2 = strlen(s2); | ||
| 785 | |||
| 786 | if ((ptr = realloc(s1, (l1+l2+1))) == NULL) | ||
| 787 | return(NULL); | ||
| 788 | s1 = ptr; | ||
| 789 | *s1p = s1; | ||
| 790 | |||
| 791 | return(strncat(s1, s2, (l1+l2+1))); | ||
| 792 | } | ||
| 793 | |||
| 794 | |||
| 771 | void ldapschema_syntax_free(LDAPSchemaSyntax * syntax) | 795 | void ldapschema_syntax_free(LDAPSchemaSyntax * syntax) |
| 772 | { | 796 | { |
| 773 | assert(syntax != NULL); | 797 | assert(syntax != NULL); |
