git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tidy up generation of java/Makefile.inc.
[libguestfs.git]
/
daemon
/
readdir.c
diff --git
a/daemon/readdir.c
b/daemon/readdir.c
index
cea6fdd
..
17fc619
100644
(file)
--- a/
daemon/readdir.c
+++ b/
daemon/readdir.c
@@
-1,5
+1,5
@@
/* libguestfs - the guestfsd daemon
/* libguestfs - the guestfsd daemon
- * Copyright (C) 2009 Red Hat Inc.
+ * Copyright (C) 2009 Red Hat Inc.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@
-63,11
+63,13
@@
do_readdir (char *path)
guestfs_int_dirent *p;
p = realloc (ret->guestfs_int_dirent_list_val,
guestfs_int_dirent *p;
p = realloc (ret->guestfs_int_dirent_list_val,
- sizeof (guestfs_int_dirent) * (i+1));
+
sizeof (guestfs_int_dirent) * (i+1));
v.name = strdup (d->d_name);
if (!p || !v.name) {
reply_with_perror ("allocate");
free (ret->guestfs_int_dirent_list_val);
v.name = strdup (d->d_name);
if (!p || !v.name) {
reply_with_perror ("allocate");
free (ret->guestfs_int_dirent_list_val);
+ free (p);
+ free (v.name);
free (ret);
closedir (dir);
return NULL;
free (ret);
closedir (dir);
return NULL;