[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] Convert src/modules to use GLib memory management exclusively.
From: |
Boris Dusek |
Subject: |
[PATCH] Convert src/modules to use GLib memory management exclusively. |
Date: |
Tue, 28 Sep 2010 15:52:39 +0200 |
On Sep 28, 2010, at 3:39 PM, Andrei Kholodnyi wrote:
> --- 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.
Yes, now I noticed as well. Getline has part of it's specification that
the buffer is ISO C-malloc'ed, realloc'ed and free'd. Using glib allocation
is wrong here.
Boris
- [PATCH] Convert src/modules to use GLib memory management exclusively., Christopher Brannon, 2010/09/23
- [PATCH] Convert src/modules to use GLib memory management exclusively., Andrei Kholodnyi, 2010/09/24
- [PATCH] Convert src/modules to use GLib memory management exclusively., Christopher Brannon, 2010/09/24
- [PATCH] Convert src/modules to use GLib memory management exclusively., Andrei Kholodnyi, 2010/09/24
- [PATCH] Convert src/modules to use GLib memory management exclusively., Christopher Brannon, 2010/09/24
- [PATCH] Convert src/modules to use GLib memory management exclusively., Andrei Kholodnyi, 2010/09/24
- [PATCH] Convert src/modules to use GLib memory management exclusively., Andrei Kholodnyi, 2010/09/28
- [PATCH] Convert src/modules to use GLib memory management exclusively.,
Boris Dusek <=
- [PATCH] Convert src/modules to use GLib memory management exclusively., Christopher Brannon, 2010/09/28
- [PATCH] Convert src/modules to use GLib memory management exclusively., Trevor Saunders, 2010/09/24
- [PATCH] Convert src/modules to use GLib memory management exclusively., Christopher Brannon, 2010/09/24
- [PATCH] Convert src/modules to use GLib memory management exclusively., Andrei Kholodnyi, 2010/09/24