summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 3d72eb5d29..7a927fb3e8 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2469,15 +2469,16 @@ int smb_mkstemp(char *name_template)
void *smb_xmalloc_array(size_t size, unsigned int count)
{
void *p;
- if (size == 0)
- smb_panic("smb_xmalloc_array: called with zero size.\n");
+ if (size == 0) {
+ smb_panic("smb_xmalloc_array: called with zero size");
+ }
if (count >= MAX_ALLOC_SIZE/size) {
- smb_panic("smb_xmalloc: alloc size too large.\n");
+ smb_panic("smb_xmalloc_array: alloc size too large");
}
if ((p = SMB_MALLOC(size*count)) == NULL) {
DEBUG(0, ("smb_xmalloc_array failed to allocate %lu * %lu bytes\n",
(unsigned long)size, (unsigned long)count));
- smb_panic("smb_xmalloc_array: malloc fail.\n");
+ smb_panic("smb_xmalloc_array: malloc failed");
}
return p;
}
@@ -2517,8 +2518,9 @@ char *smb_xstrdup(const char *s)
#endif
#define strdup(s) __ERROR_DONT_USE_STRDUP_DIRECTLY
#endif
- if (!s1)
- smb_panic("smb_xstrdup: malloc fail\n");
+ if (!s1) {
+ smb_panic("smb_xstrdup: malloc failed");
+ }
return s1;
}
@@ -2547,8 +2549,9 @@ char *smb_xstrndup(const char *s, size_t n)
#endif
#define strndup(s,n) __ERROR_DONT_USE_STRNDUP_DIRECTLY
#endif
- if (!s1)
- smb_panic("smb_xstrndup: malloc fail\n");
+ if (!s1) {
+ smb_panic("smb_xstrndup: malloc failed");
+ }
return s1;
}
@@ -2564,8 +2567,9 @@ char *smb_xstrndup(const char *s, size_t n)
VA_COPY(ap2, ap);
n = vasprintf(ptr, format, ap2);
- if (n == -1 || ! *ptr)
+ if (n == -1 || ! *ptr) {
smb_panic("smb_xvasprintf: out of memory");
+ }
return n;
}
@@ -2998,7 +3002,7 @@ void *talloc_check_name_abort(const void *ptr, const char *name)
DEBUG(0, ("Talloc type mismatch, expected %s, got %s\n",
name, talloc_get_name(ptr)));
- smb_panic("aborting");
+ smb_panic("talloc type mismatch");
/* Keep the compiler happy */
return NULL;
}