search for: free_strings

Displaying 20 results from an estimated 53 matches for "free_strings".

2012 Mar 13
2
[PATCH 0/2] 'int' to 'size_t' changes
These two patches are probably not completely independent, but separating them is a lot of work. With *both* patches applied, all the tests and extra-tests pass. That's no guarantee however that there isn't a mistake, so I don't think this patch is a candidate for the 1.16 branch, until it's had a lot more testing in development. Rich.
2012 Jan 24
14
[PATCH 00/14] Run the daemon under valgrind and fix resultant errors.
This patch series lets you run the daemon under valgrind. Many errors were found and fixed. With the complete series applied, valgrind doesn't show any errors.
2012 May 02
4
[PATCH 0/4] fish: Allow the glob command to expand device patterns (RHBZ#635971).
This patch set fixes a two year old bug in guestfish, namely that the 'glob' command does not expand /dev/* patterns. https://bugzilla.redhat.com/show_bug.cgi?id=635971 Rich.
2012 Aug 06
1
[PATCH V2] virt-diff: add new virt-diff tool
...+ mapname += 4; + len -= 4; + + if (STRPREFIX (device, "/dev/")) + i = 5; + + for (; device[i] != '\0' && len >= 1; ++i) { + if (c_isalnum (device[i])) { + *mapname++ = device[i]; + len--; + } + } + + *mapname = '\0'; +} + +static void +free_strings (char **strings) +{ + size_t i; + + for (i = 0; strings[i] != NULL; ++i) + free (strings[i]); + free (strings); +} + +static size_t +count_strings (char **strings) +{ + size_t i; + + for (i = 0; strings[i] != NULL; ++i) + ; + return i; +} + +/* Simple implementation of decryption: look...
2009 Sep 11
2
[PATCH] generator.ml: Fix string list memory leak
Parsed string lists are allocated by malloc, but were never freed. --- src/generator.ml | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/src/generator.ml b/src/generator.ml index 7571f95..c72c329 100755 --- a/src/generator.ml +++ b/src/generator.ml @@ -6320,7 +6320,7 @@ and generate_fish_cmds () = | OptString n | FileIn n |
2012 Jul 31
1
[PATCH] xfs: add new api xfs-growfs
...nc | 6 ++- po/POTFILES | 1 + src/MAX_PROC_NR | 2 +- 5 files changed, 140 insertions(+), 3 deletions(-) diff --git a/daemon/xfs.c b/daemon/xfs.c index e0f0062..97da3f1 100644 --- a/daemon/xfs.c +++ b/daemon/xfs.c @@ -348,3 +348,122 @@ error: free_strings (lines); return ret; } + +guestfs_int_xfsinfo * +do_xfs_growfs (const char *path, + int datasec, int logsec, int rtsec, + int64_t datasize, int64_t logsize, int64_t rtsize, + int64_t rtextsize, int32_t maxpct) +{ + +#define MAX_ARGS 64 + + int r; + ch...
2012 Aug 25
1
[PATCH] python: Fixed syntax errors in python/guestfs-py.c
...l.com> --- generator/generator_python.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/generator_python.ml b/generator/generator_python.ml index dc9cbca..b11df6e 100644 --- a/generator/generator_python.ml +++ b/generator/generator_python.ml @@ -391,7 +391,7 @@ free_strings (char **argv) pr " optargs_s.%s = PyString_AsString (py_%s);\n" n n; pr "#else\n"; pr " PyObject *bytes;\n"; - pr " bytes = PyUnicode_AsUTF8String (py_%s));\n" n; + pr " b...
2017 Jun 19
0
[PATCH v7 13/13] daemon: Link guestfsd with libutils.
...94b..b4767178a 100644 --- a/daemon/cleanups.c +++ b/daemon/cleanups.c @@ -24,51 +24,7 @@ #include <augeas.h> -#include "cleanups.h" - -/* Use by the CLEANUP_* macros. Do not call these directly. */ -void -cleanup_free (void *ptr) -{ - free (* (void **) ptr); -} - -extern void free_strings (char **argv); - -void -cleanup_free_string_list (void *ptr) -{ - free_strings (* (char ***) ptr); -} - -void -cleanup_unlink_free (void *ptr) -{ - char *filename = * (char **) ptr; - - if (filename) { - unlink (filename); - free (filename); - } -} - -void -cleanup_close (void *ptr) -{ -...
2011 Dec 05
1
[PATCH] blkid: split the RHEL5 which can't support some options
...ret, &size, &alloc, "UUID") == -1) goto error; + if (add_string(&ret, &size, &alloc, get_blkid_tag(device, "UUID")) == -1) + goto error; + if (add_string_nodup(&ret, &size, &alloc, NULL) == -1) goto error; + + return ret; +error: + if (ret) free_strings(ret); + return NULL; +} + +char ** +do_blkid(const char *device) +{ + int r; + char *out = NULL, *err = NULL; + char **lines = NULL; + + char **ret = NULL; + int size = 0, alloc = 0; + int blkid_has_p_opt = -1; + + if ((blkid_has_p_opt = test_blkid_p_opt()) == -1) + return NULL; + else...
2012 Aug 14
7
[PATCH 0/7] Add tar compress, numericowner, excludes flags.
https://bugzilla.redhat.com/show_bug.cgi?id=847880 https://bugzilla.redhat.com/show_bug.cgi?id=847881 This patch series adds various optional arguments to the tar-in and tar-out commands. Firstly (1/7) an optional "compress" flag is added to select compression. This makes the calls tgz-in/tgz-out/txz-in/txz-out deprecated, and expands the range of compression types available.
2013 Jan 24
3
[REVIEW ONLY] Mountable patches
These 3 patches implement support for APIs which must accept a mountable, but don't update apis which must return mountables. Matt
2009 Aug 03
1
[PATCH] Recognise cd-rom devices in devsparts.c
...- } + return 1; } - if (add_string (&r, &size, &alloc, NULL) == -1) { - closedir (dir); - return NULL; - } + if(!foreach_block_device(add_to_device_list)) return NULL; - if (closedir (dir) == -1) { - reply_with_perror ("closedir: /sys/block"); - free_strings (r); + /* Sort the devices */ + sort_strings (r, size); + + /* NULL terminate the list */ + if (add_string (&r, &size, &alloc, NULL) == -1) { return NULL; } - sort_strings (r, size-1); return r; } @@ -88,76 +69,63 @@ do_list_partitions (void) { char **r = NULL;...
2013 Feb 04
1
[PATCH] generator: Add visibility to action struct
...ed; + ) external_functions_sorted; pr "\n"; @@ -178,7 +178,7 @@ loop(Port) -> ) aliases; pr "\n" - ) all_functions_sorted + ) external_functions_sorted and generate_erlang_c () = generate_header CStyle GPLv2plus; @@ -279,7 +279,7 @@ extern void free_strings (char **r); (* generate the function for typ *) emit_copy_list_function typ | typ, _ -> () (* empty *) - ) (rstructs_used_by all_functions); + ) (rstructs_used_by external_functions); (* The wrapper functions. *) List.iter ( @@ -461,7 +461,7 @@ extern void free_s...
2012 Jan 09
1
[PATCH 1/2] generator: Rename java_structs to camel_structs to better reflect their purpose
This map was originally included just for the java bindings, but is generally useful to any binding which uses camel case by requirement or convention. --- generator/generator_haskell.ml | 4 ++-- generator/generator_java.ml | 10 +++++----- generator/generator_main.ml | 2 +- generator/generator_structs.ml | 12 +++++------- generator/generator_structs.mli | 8 ++++---- 5
2011 Dec 03
1
[PATCH] NEW API: add blkid command to print the attributes of the device
...derr, "blkid: unexpected blkid output ignored: %s", line); + } + } + + free(out); + free(err); + free(lines); + + if (add_string(&ret, &size, &alloc, NULL) == -1) return NULL; + + return ret; + +error: + free(out); + free(err); + if (lines) free(lines); + if (ret) free_strings(ret); + + return NULL; +} diff --git a/generator/generator_actions.ml b/generator/generator_actions.ml index 0e39e2f..d624f9b 100644 --- a/generator/generator_actions.ml +++ b/generator/generator_actions.ml @@ -6538,6 +6538,79 @@ The name of the MD device. This command deactivates the MD array na...
2013 Feb 07
12
[PATCH 01/12] generator: Add new Mountable argument type
...ESOLVE_DEVICE (%s, %s, goto done);\n" n (if is_filein then "cancel_receive ()" else ""); diff --git a/generator/erlang.ml b/generator/erlang.ml index 357335b..004aee4 100644 --- a/generator/erlang.ml +++ b/generator/erlang.ml @@ -293,7 +293,7 @@ extern void free_strings (char **r); fun i -> function | Pathname n - | Device n | Dev_or_Path n + | Device n | Mountable n | Dev_or_Path n | String n | FileIn n | FileOut n @@ -386,8 +386,8 @@ extern void free_strings (char **r); (...
2012 Sep 20
0
[PATCH] python: PyInt_* no longer exists in python3, replace with PyLong_*
--- generator/python.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/python.ml b/generator/python.ml index 482b189..b4bc3ce 100644 --- a/generator/python.ml +++ b/generator/python.ml @@ -381,7 +381,7 @@ free_strings (char **argv) pr " optargs_s.bitmask |= %s_%s_BITMASK;\n" c_optarg_prefix uc_n; (match optarg with | OBool _ | OInt _ -> - pr " optargs_s.%s = PyInt_AsLong (py_%s);\n" n n; + pr " optargs_s.%s = Py...
2017 Apr 25
0
[PATCH] daemon: Use CLEANUP_* functions to avoid an explicit free in stub functions.
...stfs_%s_ret ret;\n" name; pr " ret.%s.%s_len = count_strings (r);\n" n n; pr " ret.%s.%s_val = r;\n" n n; pr " reply ((xdrproc_t) &xdr_guestfs_%s_ret, (char *) &ret);\n" - name; - pr " free_strings (r);\n" + name | RStruct (n, _) -> pr " struct guestfs_%s_ret ret;\n" name; pr " ret.%s = *r;\n" n; - pr " free (r);\n"; pr " reply ((xdrproc_t) xdr_guestfs_%s_ret, (char *) &r...
2011 Nov 11
3
[PATCH v2] Add mdadm-create, list-md-devices APIs.
This adds the mdadm-create API for creating RAID devices, and includes various fixes for the other two patches. Rich.
2011 Jun 09
15
[PATCH 00/13] Fix errors found using Coverity static analyzer.
I ran the Coverity static analyzer[1] on libguestfs, and fixed many errors as a result. Coverity found some errors in gnulib, but it doesn't seem to be worth following those up since the version of gnulib we are using is so old. There are a couple more errors (possibly 1 false-positive) which I'm going to send in a separate email. BTW all the errors found by Coverity were in the daemon