summaryrefslogtreecommitdiffstats
path: root/src/format.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format.c')
-rw-r--r--src/format.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/format.c b/src/format.c
index 292dc57..40f0130 100644
--- a/src/format.c
+++ b/src/format.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008,2010 Red Hat, Inc.
+ * Copyright 2008,2010,2011 Red Hat, Inc.
*
* This Program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -168,14 +168,10 @@ format_add_sdn_list(struct slapi_dn ***list, const char *dn)
}
ret = malloc((i + 2) * sizeof(struct slapi_dn*));
if (ret != NULL) {
- for (i = 0;
- (list != NULL) && (*list != NULL) && ((*list)[i] != NULL);
- i++) {
- ret[i] = slapi_sdn_dup((*list)[i]);
- }
+ memcpy(ret, *list, i * sizeof(struct slapi_dn*));
ret[i++] = sdn;
ret[i] = NULL;
- format_free_sdn_list(*list);
+ free(*list);
*list = ret;
}
return *list;