search for: guestfs_free_

Displaying 20 results from an estimated 34 matches for "guestfs_free_".

2016 Dec 12
2
[PATCH] java: fix memory leak in RStruct actions
...@@ and generate_java_struct_return typ jtyp cols = pr " fl = (*env)->GetFieldID (env, cl, \"%s\", \"C\");\n" name; pr " (*env)->SetCharField (env, jr, fl, r->%s);\n" name; ) cols; - pr " free (r);\n"; + pr " guestfs_free_%s (r);\n" typ; pr " return jr;\n" and generate_java_struct_list_return typ jtyp cols = -- 2.7.4
2012 Oct 30
5
[PATCH v3 0/5] Add symbol versioning.
This is a simpler patch series to add symbol versioning. I have pushed patches 1-3 upstream. Rich.
2012 Oct 30
7
[PATCH v2 0/7] Add symbol versioning (now working).
This rather more complex patch series adds symbol versioning (7/7 shows it in action). This works for me, tested by running old and new virt-inspector binaries against the new library. Rich.
2017 Mar 18
0
[PATCH] python: check return value of Python APIs
...uot; guestfs_int_free_string_list (r);\n" + pr " guestfs_int_free_string_list (r);\n"; + pr " if (py_r == NULL) goto out;\n"; | RStruct (_, typ) -> pr " py_r = guestfs_int_py_put_%s (r);\n" typ; - pr " guestfs_free_%s (r);\n" typ + pr " guestfs_free_%s (r);\n" typ; + pr " if (py_r == NULL) goto out;\n"; | RStructList (_, typ) -> pr " py_r = guestfs_int_py_put_%s_list (r);\n" typ; - pr " guestfs_free_%s_list (r);\n&...
2017 Apr 25
1
[Bug #1406906] [PATCH] python: fix segmentation fault when setting non UTF-8 strings
...uot; guestfs_int_free_string_list (r);\n" + pr " guestfs_int_free_string_list (r);\n"; + pr " if (py_r == NULL) goto out;\n"; | RStruct (_, typ) -> pr " py_r = guestfs_int_py_put_%s (r);\n" typ; - pr " guestfs_free_%s (r);\n" typ + pr " guestfs_free_%s (r);\n" typ; + pr " if (py_r == NULL) goto out;\n"; | RStructList (_, typ) -> pr " py_r = guestfs_int_py_put_%s_list (r);\n" typ; - pr " guestfs_free_%s_list (r);\n&...
2017 May 11
1
[PATCH v2] RHBZ#1406906: check return value of Python object functions
...uot; guestfs_int_free_string_list (r);\n" + pr " guestfs_int_free_string_list (r);\n"; + pr " if (py_r == NULL) goto out;\n"; | RStruct (_, typ) -> pr " py_r = guestfs_int_py_put_%s (r);\n" typ; - pr " guestfs_free_%s (r);\n" typ + pr " guestfs_free_%s (r);\n" typ; + pr " if (py_r == NULL) goto out;\n"; | RStructList (_, typ) -> pr " py_r = guestfs_int_py_put_%s_list (r);\n" typ; - pr " guestfs_free_%s_list (r);\n&...
2012 Jan 18
4
[PATCH 1/4] ocaml: Add -Wno-missing-field-initializers to avoid a warning.
From: "Richard W.M. Jones" <rjones at redhat.com> --- configure.ac | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index fa97479..6e42423 100644 --- a/configure.ac +++ b/configure.ac @@ -141,6 +141,10 @@ if test "$gl_gcc_warnings" = yes; then # Work around warning in src/inspect.c. This seems to be a bug in gcc
2017 May 09
1
[PATCH] RHBZ#1406906: check return value of Python object functions
...uot; guestfs_int_free_string_list (r);\n" + pr " guestfs_int_free_string_list (r);\n"; + pr " if (py_r == NULL) goto out;\n"; | RStruct (_, typ) -> pr " py_r = guestfs_int_py_put_%s (r);\n" typ; - pr " guestfs_free_%s (r);\n" typ + pr " guestfs_free_%s (r);\n" typ; + pr " if (py_r == NULL) goto out;\n"; | RStructList (_, typ) -> pr " py_r = guestfs_int_py_put_%s_list (r);\n" typ; - pr " guestfs_free_%s_list (r);\n&...
2012 Jan 20
2
GObject bindings overview
...The top level array returned by libguestfs is freed. RStruct is converted to GObject boxed type for the target struct. It returns a copy of the struct, which is copied field by field. Memory for the returned struct is allocated using glib's slice allocator. The original struct is freed with guestfs_free_<struct>(). RStructList is converted as an array of structs, which are individually converted the same way as RStruct, i.e. everything is copied. The returned array is a newly allocated NULL-terminated array. The originally returned value is freed with guestfs_free_<struct>_list()....
2017 May 06
5
[Bug 1406906] [PATCH 0/3] Fix segmentation fault in Python bindings
This series addresses the issue where non UTF8 file names in a guest image lead to libguestfs segfault with Python 3 APIs. The core issue is the APIs are not checking the return value when constructing a new PyObject. Therefore NULL pointers are added to Python collections (lists and dictionaries) crashing the application. Few notes regarding the comments on the previous patch. - Added a
2019 Jun 27
0
[PATCH 9/9] Rust bindings: Complete bindings
...}\n"; + pr " })\n"; pr " }\n"; pr "}\n" ) external_structs; @@ -361,11 +397,26 @@ impl UUID { pr "extern \"C\" {\n"; List.iter ( fun { s_camel_name = name; s_name = c_name; } -> - pr "fn guestfs_free_%s(v: *const Raw%s);\n" c_name name; - pr "fn guestfs_free_%s_list(l: *const RawList<Raw%s>);\n" c_name name; + pr " #[allow(dead_code)]\n"; + pr " fn guestfs_free_%s(v: *const Raw%s);\n" c_name name; + pr " #[allow(dead_code...
2019 Jun 27
0
Re: [PATCH 08/11] Rust bindings: Fix memory management and format the file
...pr "}\n" ) external_structs; + (* generate free functionf of structs *) + pr "\n"; + pr "extern \"C\" {\n"; + List.iter ( + fun { s_camel_name = name; s_name = c_name; } -> + pr " #[allow(dead_code)]\n"; + pr " fn guestfs_free_%s(v: *const Raw%s);\n" c_name name; + pr " #[allow(dead_code)]\n"; + pr " fn guestfs_free_%s_list(l: *const RawList<Raw%s>);\n" c_name name; + ) external_structs; + pr "}\n"; + + (* [Outline] There are three types for each optional structs...
2017 Mar 06
7
[PATCH 0/6] Various Coverity fixes #2
Hi, this patch series fixes few more issues discovered by Coverity. Thanks, Pino Toscano (6): tail: check the return value pf guestfs_set_pgroup daemon: btrfs: check end_stringsbuf return values everywhere java: use cleanup handlers for structs (lists) as return values lib: qemu: improve handling of FILE* p2v: check more return values p2v: fix possible close(-1) issue cat/tail.c
2020 Jun 01
1
[PATCH] erlang: Port to libei for Erlang 23
...pr " return rt;\n" + pr " if (make_string_list (retbuff, r) != 0) return -1;\n"; + pr " guestfs_int_free_string_list (r);\n" | RStruct (_, typ) -> - pr " ETERM *rt = make_%s (r);\n" typ; - pr " guestfs_free_%s (r);\n" typ; - pr " return rt;\n" + pr " if (make_%s (retbuff, r) != 0) return -1;\n" typ; + pr " guestfs_free_%s (r);\n" typ | RStructList (_, typ) -> - pr " ETERM *rt = make_%s_list (r);\n" typ;...
2016 Dec 12
0
[PATCH] perl: fix memory leak in RStruct actions
...687..4c7f805 100644 --- a/generator/perl.ml +++ b/generator/perl.ml @@ -657,7 +657,7 @@ and generate_perl_struct_code typ cols name style n = pr " PUSHs (sv_2mortal (newSVnv (r->%s)));\n" name ) cols; - pr " free (r);\n" + pr " guestfs_free_%s (r);\n" typ (* Generate Sys/Guestfs.pm. *) and generate_perl_pm () = -- 2.7.4
2019 Jun 27
4
Re: [PATCH 9/9] Rust bindings: Complete bindings
Patch 9 is a kind of dumping ground of all kinds of stuff. It may be better to spend some time with git rebase -i trying to work this into more coherent patches. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live
2019 Jun 27
16
[PATCH 1/9] Rust bindings: Add Rust bindings
From: Hiroyuki_Katsura <hiroyuki.katsura.0513@gmail.com> --- Makefile.am | 4 ++++ configure.ac | 3 +++ generator/Makefile.am | 3 +++ generator/bindtests.ml | 3 +++ generator/bindtests.mli | 1 + generator/main.ml | 5 +++++ generator/rust.ml | 34 ++++++++++++++++++++++++++++++++++ generator/rust.mli | 19 +++++++++++++++++++
2013 Jan 30
1
[PATCH] Make internal-only functions and structures private
...t generate_all_structs = List.iter ( fun { s_name = typ; s_cols = cols } -> pr "struct guestfs_%s {\n" typ; List.iter ( @@ -603,7 +603,9 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s (struct guestfs_%s *);\n" typ typ; pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s_list (struct guestfs_%s_list *);\n" typ typ; pr "\n" - ) structs; + ) in + + generate_all_structs external_structs; pr "\ /* Actions. */ @@ -673,7 +675,7 @@...
2009 Aug 03
1
[PATCH 1/2] Convert all TABs-as-indentation to spaces.
...if (w == NULL) { - free_words (words, nr_words); - words = NULL; - nr_words = 0; - } - else { - words = w; - words[nr_words].name = p; - words[nr_words].is_dir = dirents->val[i].ftyp == 'd'; - nr_words++; - } - } - } - } - } - - guestfs_free_dirent_list (dirents); - } + dirents = guestfs_readdir (g, dir); + + /* Prepend directory to names before adding them to the list + * of words. + */ + if (dirents) { + size_t i; + + for (i = 0; i < dirents->len; ++i) { + int err...
2016 Nov 08
4
[PATCH 1/3] generator: c: move internal functions
...fun { s_name = typ; s_cols = cols } -> pr "#define GUESTFS_HAVE_STRUCT_%s 1\n" (String.uppercase typ); pr "\n"; @@ -634,14 +698,9 @@ extern GUESTFS_DLL_PUBLIC void *guestfs_next_private (guestfs_h *g, const char * pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s (struct guestfs_%s *);\n" typ typ; pr "extern GUESTFS_DLL_PUBLIC void guestfs_free_%s_list (struct guestfs_%s_list *);\n" typ typ; pr "\n" - ) in - - generate_all_structs external_structs; - - pr "\ -/* Actions. */ -"; + ) structs +and genera...