1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-10 12:58:35 +03:00

r20110: Fix interaction between paranoid malloc checker

and lib/replace. Found by Herb - thanks !
Jeremy.
This commit is contained in:
Jeremy Allison 2006-12-11 18:56:36 +00:00 committed by Gerald (Jerry) Carter
parent f83b6de44f
commit 67c4d5e73f

@ -2434,8 +2434,16 @@ char *smb_xstrdup(const char *s)
#undef strdup
#endif
#endif
#ifndef HAVE_STRDUP
#define strdup rep_strdup
#endif
char *s1 = strdup(s);
#if defined(PARANOID_MALLOC_CHECKER)
#ifdef strdup
#undef strdup
#endif
#define strdup(s) __ERROR_DONT_USE_STRDUP_DIRECTLY
#endif
if (!s1)
@ -2455,8 +2463,17 @@ char *smb_xstrndup(const char *s, size_t n)
#undef strndup
#endif
#endif
#if (defined(BROKEN_STRNDUP) || !defined(HAVE_STRNDUP))
#undef HAVE_STRNDUP
#define strndup rep_strndup
#endif
char *s1 = strndup(s, n);
#if defined(PARANOID_MALLOC_CHECKER)
#ifdef strndup
#undef strndup
#endif
#define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY
#endif
if (!s1)