summaryrefslogtreecommitdiff
path: root/sbin/fsirand
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-09-24 20:40:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-09-24 20:40:20 +0000
commit76babf87a3062e78fa213f8870a403b3da878020 (patch)
tree5a9e5e5c1c3cf4e28d259f8aa172987941098131 /sbin/fsirand
parent3ee08ce607314cf704bf3875b67bc414b72a0464 (diff)
realloc fixes; ok ho
Diffstat (limited to 'sbin/fsirand')
-rw-r--r--sbin/fsirand/fsirand.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sbin/fsirand/fsirand.c b/sbin/fsirand/fsirand.c
index 5fd052d6b79..41f7ea67e0f 100644
--- a/sbin/fsirand/fsirand.c
+++ b/sbin/fsirand/fsirand.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsirand.c,v 1.19 2003/08/25 23:28:15 tedu Exp $ */
+/* $OpenBSD: fsirand.c,v 1.20 2003/09/24 20:40:19 deraadt Exp $ */
/*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -17,7 +17,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: fsirand.c,v 1.19 2003/08/25 23:28:15 tedu Exp $";
+static char rcsid[] = "$OpenBSD: fsirand.c,v 1.20 2003/09/24 20:40:19 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -179,8 +179,11 @@ fsirand(char *device)
/* XXX - should really cap buffer at 512kb or so */
ibufsize = sizeof(struct ufs1_dinode) * sblock->fs_ipg;
if (oldibufsize < ibufsize) {
- if ((inodebuf = realloc(inodebuf, ibufsize)) == NULL)
+ struct ufs1_dinode *ib;
+
+ if ((ib = realloc(inodebuf, ibufsize)) == NULL)
errx(1, "Can't allocate memory for inode buffer");
+ inodebuf = ib;
oldibufsize = ibufsize;
}