X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=sidebyside;f=servers%2Fslapd%2Fsl_malloc.c;h=fc8eb745c7a0fab0669f8b19f7b5831927bd835b;hb=624642ba839c70397f15887a2632a6aabb77df0f;hp=f47f4c643c11b6daa1fe0fcf2277663bcb4d7973;hpb=001f14965402aa86f3d7cd364fc781caeb603719;p=openldap diff --git a/servers/slapd/sl_malloc.c b/servers/slapd/sl_malloc.c index f47f4c643c..fc8eb745c7 100644 --- a/servers/slapd/sl_malloc.c +++ b/servers/slapd/sl_malloc.c @@ -2,7 +2,7 @@ /* $OpenLDAP$ */ /* This work is part of OpenLDAP Software . * - * Copyright 2003-2011 The OpenLDAP Foundation. + * Copyright 2003-2012 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -222,7 +222,7 @@ slap_sl_mem_create( VGMEMP_CHANGE(sh, base, newptr, size); base = newptr; } - VGMEMP_TRIM(sh, sh->sh_base, 0); + VGMEMP_TRIM(sh, base, 0); } sh->sh_base = base; sh->sh_end = base + size; @@ -522,7 +522,8 @@ slap_sl_free(void *ptr, void *ctx) p = (ber_len_t *) ((char *) p - p[-1]); } sh->sh_last = p; - VGMEMP_TRIM(sh, sh->sh_base, sh->sh_last - sh->sh_base); + VGMEMP_TRIM(sh, sh->sh_base, + (char *) sh->sh_last - (char *) sh->sh_base); } } else {