diff options
author | Timo Dritschler <timo.dritschler@kit.edu> | 2014-11-26 18:49:58 +0100 |
---|---|---|
committer | Timo Dritschler <timo.dritschler@kit.edu> | 2014-11-26 18:49:58 +0100 |
commit | 8df0836960547bbbf8e75a87efc45cd31d9f65c4 (patch) | |
tree | 0221e1a2b298a47e959905eaac00fadcb5f6490b /src/kiro-trb.c | |
parent | 3dc2e76f0d6cf350f41c574726d354f1a81591a6 (diff) | |
parent | fcec7a701ef599c432f29f13ce82bfdb464d7ee7 (diff) | |
download | kiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.tar.gz kiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.tar.bz2 kiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.tar.xz kiro-8df0836960547bbbf8e75a87efc45cd31d9f65c4.zip |
Merge branch 'master' into eventLoops
Diffstat (limited to 'src/kiro-trb.c')
-rw-r--r-- | src/kiro-trb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/kiro-trb.c b/src/kiro-trb.c index 6a303d2..585e8e3 100644 --- a/src/kiro-trb.c +++ b/src/kiro-trb.c @@ -98,7 +98,7 @@ kiro_trb_finalize (GObject *object) KiroTrbPrivate *priv = KIRO_TRB_GET_PRIVATE (self); if (priv->mem) - free (priv->mem); + g_free (priv->mem); G_OBJECT_CLASS (kiro_trb_parent_class)->finalize (object); } @@ -223,7 +223,7 @@ kiro_trb_purge (KiroTrb *self, gboolean free_memory) priv->element_size = 0; if (free_memory) - free (priv->mem); + g_free (priv->mem); priv->mem = NULL; } @@ -244,7 +244,7 @@ kiro_trb_reshape (KiroTrb *self, uint64_t element_size, uint64_t element_count) return -1; size_t new_size = (element_size * element_count) + sizeof (struct KiroTrbInfo); - void *newmem = malloc (new_size); + void *newmem = g_try_malloc0 (new_size); if (!newmem) return -1; @@ -333,7 +333,7 @@ kiro_trb_adopt (KiroTrb *self, void *buff_in) KiroTrbPrivate *priv = KIRO_TRB_GET_PRIVATE (self); if (priv->mem) - free (priv->mem); + g_free (priv->mem); priv->mem = buff_in; priv->initialized = 1; @@ -346,7 +346,7 @@ kiro_trb_clone (KiroTrb *self, void *buff_in) { KiroTrbPrivate *priv = KIRO_TRB_GET_PRIVATE (self); struct KiroTrbInfo *header = (struct KiroTrbInfo *)buff_in; - void *newmem = malloc (header->buffer_size_bytes); + void *newmem = g_try_malloc0 (header->buffer_size_bytes); if (!newmem) return -1; @@ -354,7 +354,7 @@ kiro_trb_clone (KiroTrb *self, void *buff_in) memcpy (newmem, buff_in, header->buffer_size_bytes); if (priv->mem) - free (priv->mem); + g_free (priv->mem); priv->mem = newmem; priv->initialized = 1; |