diff options
author | Colin Watson <cjwatson@debian.org> | 2013-09-14 15:43:03 +0100 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2013-09-14 15:43:03 +0100 |
commit | 8faf8c84430cf3c19705b1d9f8889d256e7fd1fd (patch) | |
tree | e6cb74192adb00fda5e4d1457547851d7e0d86af /monitor_mm.c | |
parent | 328b60656f29db6306994d7498dede386ec2d1c3 (diff) | |
parent | c41345ad7ee5a22689e2c009595e85fa27b4b39a (diff) |
merge 6.3p1
Diffstat (limited to 'monitor_mm.c')
-rw-r--r-- | monitor_mm.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/monitor_mm.c b/monitor_mm.c index faf9f3dcb..ee7bad4b4 100644 --- a/monitor_mm.c +++ b/monitor_mm.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: monitor_mm.c,v 1.16 2009/06/22 05:39:28 dtucker Exp $ */ | 1 | /* $OpenBSD: monitor_mm.c,v 1.17 2013/05/17 00:13:13 djm Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright 2002 Niels Provos <provos@citi.umich.edu> | 3 | * Copyright 2002 Niels Provos <provos@citi.umich.edu> |
4 | * All rights reserved. | 4 | * All rights reserved. |
@@ -35,6 +35,7 @@ | |||
35 | 35 | ||
36 | #include <errno.h> | 36 | #include <errno.h> |
37 | #include <stdarg.h> | 37 | #include <stdarg.h> |
38 | #include <stdlib.h> | ||
38 | #include <string.h> | 39 | #include <string.h> |
39 | 40 | ||
40 | #include "xmalloc.h" | 41 | #include "xmalloc.h" |
@@ -124,7 +125,7 @@ mm_freelist(struct mm_master *mmalloc, struct mmtree *head) | |||
124 | next = RB_NEXT(mmtree, head, mms); | 125 | next = RB_NEXT(mmtree, head, mms); |
125 | RB_REMOVE(mmtree, head, mms); | 126 | RB_REMOVE(mmtree, head, mms); |
126 | if (mmalloc == NULL) | 127 | if (mmalloc == NULL) |
127 | xfree(mms); | 128 | free(mms); |
128 | else | 129 | else |
129 | mm_free(mmalloc, mms); | 130 | mm_free(mmalloc, mms); |
130 | } | 131 | } |
@@ -147,7 +148,7 @@ mm_destroy(struct mm_master *mm) | |||
147 | __func__); | 148 | __func__); |
148 | #endif | 149 | #endif |
149 | if (mm->mmalloc == NULL) | 150 | if (mm->mmalloc == NULL) |
150 | xfree(mm); | 151 | free(mm); |
151 | else | 152 | else |
152 | mm_free(mm->mmalloc, mm); | 153 | mm_free(mm->mmalloc, mm); |
153 | } | 154 | } |
@@ -198,7 +199,7 @@ mm_malloc(struct mm_master *mm, size_t size) | |||
198 | if (mms->size == 0) { | 199 | if (mms->size == 0) { |
199 | RB_REMOVE(mmtree, &mm->rb_free, mms); | 200 | RB_REMOVE(mmtree, &mm->rb_free, mms); |
200 | if (mm->mmalloc == NULL) | 201 | if (mm->mmalloc == NULL) |
201 | xfree(mms); | 202 | free(mms); |
202 | else | 203 | else |
203 | mm_free(mm->mmalloc, mms); | 204 | mm_free(mm->mmalloc, mms); |
204 | } | 205 | } |
@@ -254,7 +255,7 @@ mm_free(struct mm_master *mm, void *address) | |||
254 | prev->size += mms->size; | 255 | prev->size += mms->size; |
255 | RB_REMOVE(mmtree, &mm->rb_free, mms); | 256 | RB_REMOVE(mmtree, &mm->rb_free, mms); |
256 | if (mm->mmalloc == NULL) | 257 | if (mm->mmalloc == NULL) |
257 | xfree(mms); | 258 | free(mms); |
258 | else | 259 | else |
259 | mm_free(mm->mmalloc, mms); | 260 | mm_free(mm->mmalloc, mms); |
260 | } else | 261 | } else |
@@ -278,7 +279,7 @@ mm_free(struct mm_master *mm, void *address) | |||
278 | RB_REMOVE(mmtree, &mm->rb_free, mms); | 279 | RB_REMOVE(mmtree, &mm->rb_free, mms); |
279 | 280 | ||
280 | if (mm->mmalloc == NULL) | 281 | if (mm->mmalloc == NULL) |
281 | xfree(mms); | 282 | free(mms); |
282 | else | 283 | else |
283 | mm_free(mm->mmalloc, mms); | 284 | mm_free(mm->mmalloc, mms); |
284 | } | 285 | } |