This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

fix reversed assertions, don't double free

  • Loading branch information...
tomato42 committed Aug 2, 2012
1 parent 9252a13 commit 45f4b9451673b7a1dadb7ec4c2a2363438acf989
Showing with 3 additions and 3 deletions.
  1. +3 −3 extents.c
View
@@ -93,7 +93,7 @@ struct extent *
get_extent(struct extents *e, size_t nmemb)
{
assert(e);
- assert(e->length < nmemb);
+ assert(e->length > nmemb);
return (e->extents[nmemb]);
}
@@ -117,14 +117,14 @@ truncate_extents(struct extents *e, size_t len)
assert(e);
assert(e->extents);
- assert(e->length < len);
+ assert(e->length > len);
struct extent **ext;
ext = realloc(e->extents, sizeof(struct extent*) * len);
if (!ext) {
- free(e->extents);
+ //free(e->extents);
e->extents = NULL;
e->length = 0;
return;

0 comments on commit 45f4b94

Please sign in to comment.