Use g_autofree instead of gs_free
This commit is contained in:
1 parent
4f33515316
commit
7a62d64968
67 files changed
+316
-316
No files matched your search
@@ -112,7 +112,7 @@ ot_gio_splice_get_checksum (GOutputStream *out,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
GChecksum *checksum = NULL;
|
||||
gs_free guchar *ret_csum = NULL;
|
||||
g_autofree guchar *ret_csum = NULL;
|
||||
|
||||
checksum = g_checksum_new (G_CHECKSUM_SHA256);
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ ot_lgetxattrat (int dfd,
|
||||
/* A workaround for the lack of lgetxattrat(), thanks to Florian Weimer:
|
||||
* https://mail.gnome.org/archives/ostree-list/2014-February/msg00017.html
|
||||
*/
|
||||
gs_free char *full_path = g_strdup_printf ("/proc/self/fd/%d/%s", dfd, path);
|
||||
g_autofree char *full_path = g_strdup_printf ("/proc/self/fd/%d/%s", dfd, path);
|
||||
GBytes *bytes = NULL;
|
||||
ssize_t bytes_read, real_size;
|
||||
char *buf;
|
||||
@@ -103,7 +103,7 @@ ot_lsetxattrat (int dfd,
|
||||
/* A workaround for the lack of lsetxattrat(), thanks to Florian Weimer:
|
||||
* https://mail.gnome.org/archives/ostree-list/2014-February/msg00017.html
|
||||
*/
|
||||
gs_free char *full_path = g_strdup_printf ("/proc/self/fd/%d/%s", dfd, path);
|
||||
g_autofree char *full_path = g_strdup_printf ("/proc/self/fd/%d/%s", dfd, path);
|
||||
int res;
|
||||
|
||||
do
|
||||
|
||||
@@ -56,7 +56,7 @@ ot_gfile_from_build_path (const char *first, ...)
|
||||
{
|
||||
va_list args;
|
||||
const char *arg;
|
||||
gs_free char *path = NULL;
|
||||
g_autofree char *path = NULL;
|
||||
gs_unref_ptrarray GPtrArray *components = NULL;
|
||||
|
||||
va_start (args, first);
|
||||
@@ -113,7 +113,7 @@ ot_gfile_get_child_build_path (GFile *parent,
|
||||
{
|
||||
va_list args;
|
||||
const char *arg;
|
||||
gs_free char *path = NULL;
|
||||
g_autofree char *path = NULL;
|
||||
gs_unref_ptrarray GPtrArray *components = NULL;
|
||||
|
||||
va_start (args, first);
|
||||
@@ -142,7 +142,7 @@ ot_gfile_resolve_path_printf (GFile *path,
|
||||
...)
|
||||
{
|
||||
va_list args;
|
||||
gs_free char *relpath = NULL;
|
||||
g_autofree char *relpath = NULL;
|
||||
|
||||
va_start (args, format);
|
||||
relpath = g_strdup_vprintf (format, args);
|
||||
@@ -252,7 +252,7 @@ ot_gfile_load_contents_utf8_allow_noent (GFile *path,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
GError *temp_error = NULL;
|
||||
gs_free char *ret_contents = NULL;
|
||||
g_autofree char *ret_contents = NULL;
|
||||
|
||||
ret_contents = gs_file_load_contents_utf8 (path, cancellable, &temp_error);
|
||||
if (!ret_contents)
|
||||
@@ -290,7 +290,7 @@ ot_file_replace_contents_at (int dfd,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
int fd;
|
||||
gs_free char *tmpname = NULL;
|
||||
g_autofree char *tmpname = NULL;
|
||||
gs_unref_object GOutputStream *stream = NULL;
|
||||
gs_unref_object GInputStream *instream = NULL;
|
||||
|
||||
@@ -529,7 +529,7 @@ ot_gfile_atomic_symlink_swap (GFile *path,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
gs_unref_object GFile *parent = g_file_get_parent (path);
|
||||
gs_free char *tmpname = g_strconcat (gs_file_get_basename_cached (path), ".tmp", NULL);
|
||||
g_autofree char *tmpname = g_strconcat (gs_file_get_basename_cached (path), ".tmp", NULL);
|
||||
gs_unref_object GFile *tmppath = g_file_get_child (parent, tmpname);
|
||||
int parent_dfd = -1;
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ ot_keyfile_get_value_with_default (GKeyFile *keyfile,
|
||||
{
|
||||
gboolean ret = FALSE;
|
||||
GError *temp_error = NULL;
|
||||
gs_free char *ret_value = NULL;
|
||||
g_autofree char *ret_value = NULL;
|
||||
|
||||
g_return_val_if_fail (keyfile != NULL, ret);
|
||||
g_return_val_if_fail (section != NULL, ret);
|
||||
@@ -120,7 +120,7 @@ ot_keyfile_copy_group (GKeyFile *source_keyfile,
|
||||
|
||||
for (ii = 0; ii < length; ii++)
|
||||
{
|
||||
gs_free char *value = NULL;
|
||||
g_autofree char *value = NULL;
|
||||
|
||||
value = g_key_file_get_value (source_keyfile, group_name, keys[ii], NULL);
|
||||
g_key_file_set_value (target_keyfile, group_name, keys[ii], value);
|
||||
|
||||
Reference in new issue
Block a user