util/error: Fix leak in error_vprepend()
PATCH 1/1 util/error: Fix leak in error_vprepend()
Signed-off-by Max Reitz <[email protected]>
--- util/error.c | 1 + 1 file changed, 1 insertion(+)
util/error.c +1 -0
@@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap) newmsg =g_string_new (NULL );g_string_vprintf (newmsg, fmt, ap);g_string_append (newmsg, (*errp)->msg); +g_free ((*errp)->msg); (*errp)->msg =g_string_free (newmsg,0 ); }
Signature · 1 line
2.12.2
Quoted 21 lines · Max Reitz
Signed-off-by Max Reitz <[email protected]>--- util/error.c | 1 + 1 file changed, 1 insertion(+)util/error.c +1
-0@@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap) newmsg =g_string_new (NULL );g_string_vprintf (newmsg, fmt, ap);g_string_append (newmsg, (*errp)->msg); +g_free ((*errp)->msg); (*errp)->msg =g_string_free (newmsg,0 ); }Signature · 1 line
2.12.2
Reviewed-by Fam Zheng <[email protected]>
Quoted 21 lines · Max Reitz
Signed-off-by Max Reitz <[email protected]>--- util/error.c | 1 + 1 file changed, 1 insertion(+)util/error.c +1
-0@@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap) newmsg =g_string_new (NULL );g_string_vprintf (newmsg, fmt, ap);g_string_append (newmsg, (*errp)->msg); +g_free ((*errp)->msg); (*errp)->msg =g_string_free (newmsg,0 ); }Signature · 1 line
2.12.2
Reviewed-by Jeff Cody <[email protected]>
Markus Armbruster
AppliedQuoted 10 lines · Max Reitz
Signed-off-by Max Reitz <[email protected]>--- util/error.c | 1 + 1 file changed, 1 insertion(+)util/error.c +0
-0
util/error.c void error_vprepend(Error **errp, const char *fmt, va_list ap) · line 139
Quoted 6 lines
util/error.c +1
-0@@ -134,6 +134,7 @@ void error_vprepend(Error **errp, const char *fmt, va_list ap) newmsg =g_string_new (NULL );g_string_vprintf (newmsg, fmt, ap);g_string_append (newmsg, (*errp)->msg); +g_free ((*errp)->msg); (*errp)->msg =g_string_free (newmsg,0 ); }
Applied to error-next, thanks!