speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Convert src/modules to use GLib memory management exclusively.


From: Andrei Kholodnyi
Subject: [PATCH] Convert src/modules to use GLib memory management exclusively.
Date: Tue, 28 Sep 2010 15:39:52 +0200

--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -54,7 +54,7 @@ ssize_t getline (char **lineptr, size_t *n, FILE *f)
                if ( m++ >= buf_len )
                {
                        buf_len += BUFFER_LEN;
-                        buf = (char *) realloc(buf, buf_len + 1);
+                        buf = (char *) g_realloc(buf, buf_len + 1);

Hi Chris,

you have modified a local version of getline in output.c and module_utils.c
now it uses g_realloc instead of realloc.
this version is still conditionally compiled, i.e. normally GNU
version will be used, which has realloc in it.
But all strings used in the getline calls are now g_freed.

Andrei.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]