[gjs] byteArray: Fix mismatched g_new()/g_slice_free()
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] byteArray: Fix mismatched g_new()/g_slice_free()
- Date: Fri, 19 Nov 2010 19:09:18 +0000 (UTC)
commit 53a6f43b502e2448826669c3ed29320d74f63b68
Author: Colin Walters <walters verbum org>
Date: Fri Nov 19 14:05:00 2010 -0500
byteArray: Fix mismatched g_new()/g_slice_free()
GByteArray must be created with g_byte_array_new(), since
g_byte_array_free() uses g_slice, but we were using g_new().
gjs/byteArray.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gjs/byteArray.c b/gjs/byteArray.c
index e4b47af..b00be17 100644
--- a/gjs/byteArray.c
+++ b/gjs/byteArray.c
@@ -800,7 +800,7 @@ gjs_byte_array_from_byte_array (JSContext *context,
priv = g_slice_new0(ByteArrayInstance);
g_assert(priv_from_js(context, object) == NULL);
JS_SetPrivate(context, object, priv);
- priv->array = g_new(GByteArray, 1);
+ priv->array = g_byte_array_new();
priv->array->data = g_memdup(array->data, array->len);
priv->array->len = array->len;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]