diff options
| author | Peter Maydell <peter.maydell@linaro.org> | 2014-08-25 17:34:30 +0100 |
|---|---|---|
| committer | Peter Maydell <peter.maydell@linaro.org> | 2014-08-25 17:34:30 +0100 |
| commit | 3dd359c2d34c6abf385d58da863f337b39702585 (patch) | |
| tree | 2097c65507985aa466f854093a373d0653572df4 /util/path.c | |
| parent | 33886ebeec0c0ff6253a49253fae0db44c9ed0f3 (diff) | |
| parent | 40a87c6c9b11ef9c14e0301f76abf0eb2582f08e (diff) | |
| download | focaccia-qemu-3dd359c2d34c6abf385d58da863f337b39702585.tar.gz focaccia-qemu-3dd359c2d34c6abf385d58da863f337b39702585.zip | |
Merge remote-tracking branch 'remotes/mjt/tags/trivial-patches-2014-08-24' into staging
trivial patches for 2014-08-24 # gpg: Signature made Sun 24 Aug 2014 14:28:49 BST using RSA key ID A4C3D7DB # gpg: Good signature from "Michael Tokarev <mjt@tls.msk.ru>" # gpg: aka "Michael Tokarev <mjt@corpit.ru>" # gpg: aka "Michael Tokarev <mjt@debian.org>" # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 6EE1 95D1 886E 8FFB 810D 4324 457C E0A0 8044 65C5 # Subkey fingerprint: 6F67 E18E 7C91 C5B1 5514 66A7 BEE5 9D74 A4C3 D7DB * remotes/mjt/tags/trivial-patches-2014-08-24: vmxnet3: Pad short frames to minimum size (60 bytes) libdecnumber: Fix warnings from smatch (missing static, boolean operations) linux-user: fix file descriptor leaks po: Fix Makefile rules for in-tree builds without configuration slirp/misc: Use the GLib memory allocation APIs configure: no need to mkdir QMP dma: axidma: Variablise repeated s->streams[i] sub-expr microblaze: ml605: Get rid of ddr_base variable tests/bios-tables-test: check the value returned by fopen() tcg: dump op count into qemu log util/path: Use the GLib memory allocation routines Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util/path.c')
| -rw-r--r-- | util/path.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util/path.c b/util/path.c index 5c59d9f1d3..4e4877e821 100644 --- a/util/path.c +++ b/util/path.c @@ -45,8 +45,8 @@ static struct pathelem *new_entry(const char *root, struct pathelem *parent, const char *name) { - struct pathelem *new = malloc(sizeof(*new)); - new->name = strdup(name); + struct pathelem *new = g_malloc(sizeof(*new)); + new->name = g_strdup(name); new->pathname = g_strdup_printf("%s/%s", root, name); new->num_entries = 0; return new; @@ -88,7 +88,7 @@ static struct pathelem *add_entry(struct pathelem *root, const char *name, root->num_entries++; - root = realloc(root, sizeof(*root) + root = g_realloc(root, sizeof(*root) + sizeof(root->entries[0])*root->num_entries); e = &root->entries[root->num_entries-1]; @@ -161,8 +161,8 @@ void init_paths(const char *prefix) base = add_dir_maybe(base); if (base->num_entries == 0) { g_free(base->pathname); - free(base->name); - free(base); + g_free(base->name); + g_free(base); base = NULL; } else { set_parents(base, base); |