summaryrefslogtreecommitdiff
path: root/src/pqueue.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-11-18 22:45:56 +0100
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-11-18 22:45:56 +0100
commitbdd31dd5e832126b2f22fccbe244a1106c241ab0 (patch)
treeb08a2ad0fad57131563aa8c071221bea241128c1 /src/pqueue.c
parent277b7efe493887081ce1dafd91199d0ee9f676c9 (diff)
parente4c93a392763a006d11e1c1dd01c12f85498dad5 (diff)
downloadlibgit2-error-handling.tar.gz
Merge branch 'development' into error-handlingerror-handling
The code in this branch has been modified so it works with the global state introduced in development.
Diffstat (limited to 'src/pqueue.c')
-rw-r--r--src/pqueue.c6
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;