commit 3a0ac9efa8f8696a924480bcfb34e28bc5bcae7a parent 502474a0d4b00ecc461e82042f853fef06fc858c Author: wwp <subscript@free.fr> Date: Thu, 7 Oct 2021 09:52:13 +0200 Fix CID 1491058: resource leak (a good old one). Diffstat:
| M | src/ldif.c | | | 5 | ++--- |
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/ldif.c b/src/ldif.c @@ -239,7 +239,7 @@ static void ldif_close_file( LdifFile *ldifFile ) { /** * Read line of text from file. * \param ldifFile LDIF import control object. - * \return ptr to buffer where line starts. + * \return ptr to buffer where line starts (must be freed by caller). */ static gchar *ldif_get_line( LdifFile *ldifFile ) { gchar *buf = g_malloc(LDIFBUFSIZE); @@ -279,8 +279,7 @@ static gchar *ldif_get_line( LdifFile *ldifFile ) { } buf[i] = '\0'; - /* Return a copy of buffer */ - return g_strdup( buf ); + return buf; } /**