[Pkg-libvirt-commits] [libguestfs] 27/36: daemon: introduce free_stringsbuf

Hilko Bengen bengen at moszumanska.debian.org
Sun Nov 1 17:13:44 UTC 2015


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag upstream/1.29.47
in repository libguestfs.

commit 26a0ccdb4ea7cb9239f8ce1ffeefc925ed49f341
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Wed Jun 17 12:23:06 2015 +0200

    daemon: introduce free_stringsbuf
    
    Simple shortcut to easily cleanup a stringsbuf.
---
 daemon/daemon.h   | 1 +
 daemon/guestfsd.c | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/daemon/daemon.h b/daemon/daemon.h
index 53cb797..bed4dbc 100644
--- a/daemon/daemon.h
+++ b/daemon/daemon.h
@@ -92,6 +92,7 @@ extern int add_string (struct stringsbuf *sb, const char *str);
 extern int add_sprintf (struct stringsbuf *sb, const char *fs, ...)
   __attribute__((format (printf,2,3)));
 extern int end_stringsbuf (struct stringsbuf *sb);
+extern void free_stringsbuf (struct stringsbuf *sb);
 
 extern size_t count_strings (char *const *argv);
 extern void sort_strings (char **argv, size_t len);
diff --git a/daemon/guestfsd.c b/daemon/guestfsd.c
index c912ee3..453dee1 100644
--- a/daemon/guestfsd.c
+++ b/daemon/guestfsd.c
@@ -587,6 +587,13 @@ end_stringsbuf (struct stringsbuf *sb)
   return add_string_nodup (sb, NULL);
 }
 
+void
+free_stringsbuf (struct stringsbuf *sb)
+{
+  if (sb->argv != NULL)
+    free_stringslen (sb->argv, sb->size);
+}
+
 size_t
 count_strings (char *const *argv)
 {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list