talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 1a6649b3f22aa6851435ed3c9772152fd99000c9
parent 9869b88395d4977eea4773953b41d337b7994949
Author: wwp <subscript@free.fr>
Date:   Thu,  7 Oct 2021 09:52:13 +0200

Fix CID 1491058: resource leak (a good old one).

Diffstat:
Msrc/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; } /**