diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-10-29 01:51:13 +0400 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-10-29 06:02:36 +0400 |
commit | 3286c408eccb18c525ca123383f3ebf5097441bc (patch) | |
tree | 4422fe16ab4f7b9cf713e0209cbb74fb4115889e /src/pqueue.c | |
parent | da37654d04617b4dacce6e7a4796007d2854624d (diff) |
global: Properly use `git__` memory wrappers
Ensure that all memory related functions (malloc, calloc, strdup, free,
etc) are using their respective `git__` wrappers.
Diffstat (limited to 'src/pqueue.c')
-rw-r--r-- | src/pqueue.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/pqueue.c b/src/pqueue.c index b5ddab835..80713fbba 100644 --- a/src/pqueue.c +++ b/src/pqueue.c @@ -17,7 +17,7 @@ int git_pqueue_init(git_pqueue *q, size_t n, git_pqueue_cmp cmppri) assert(q); /* Need to allocate n+1 elements since element 0 isn't used. */ - if ((q->d = malloc((n + 1) * sizeof(void *))) == NULL) + if ((q->d = git__malloc((n + 1) * sizeof(void *))) == NULL) return GIT_ENOMEM; q->size = 1; @@ -30,7 +30,7 @@ int git_pqueue_init(git_pqueue *q, size_t n, git_pqueue_cmp cmppri) void git_pqueue_free(git_pqueue *q) { - free(q->d); + git__free(q->d); q->d = NULL; } @@ -102,7 +102,7 @@ int git_pqueue_insert(git_pqueue *q, void *d) /* allocate more memory if necessary */ if (q->size >= q->avail) { newsize = q->size + q->step; - if ((tmp = realloc(q->d, sizeof(void *) * newsize)) == NULL) + if ((tmp = git__realloc(q->d, sizeof(void *) * newsize)) == NULL) return GIT_ENOMEM; q->d = tmp; |