tree-wide: Convert to using autoptr(GString) vs g_string_free(...,TRUE)

If we're freeing the segment, it's basically always better to use
`autoptr()`.  Fewer lines, more reliable, etc.

Noticed an instance of this in the pull code while reviewing a different PR,
decided to do a grep for it and fix it tree wide.

Closes: #836
Approved by: pwithnall
This commit is contained in:
Colin Walters authored and Atomic Bot committed 2017-05-05 15:10:51 +00:00
1 parent bf9772f231
commit 712bf21914
13 files changed
+21 -63

No files matched your search

+1 -2
View File
@@ -28,11 +28,10 @@
#define assert_no_gpg_error(err, filename) \
G_STMT_START { \
if (err != GPG_ERR_NO_ERROR) { \
GString *string = g_string_new ("assertion failed "); \
g_autoptr(GString) string = g_string_new ("assertion failed "); \
g_string_append_printf (string, "%s: %s ", gpgme_strsource (err), gpgme_strerror (err)); \
g_string_append (string, filename ? filename : ""); \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, string->str); \
g_string_free (string, TRUE); \
} \
} G_STMT_END