Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/dist/pdisk avoid freeing uninitialized pointer



details:   https://anonhg.NetBSD.org/src/rev/ab6492204532
branches:  trunk
changeset: 546213:ab6492204532
user:      dbj <dbj%NetBSD.org@localhost>
date:      Tue Apr 22 17:04:06 2003 +0000

description:
avoid freeing uninitialized pointer

diffstat:

 dist/pdisk/pdisk.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r e28f84787b7b -r ab6492204532 dist/pdisk/pdisk.c
--- a/dist/pdisk/pdisk.c        Tue Apr 22 16:48:19 2003 +0000
+++ b/dist/pdisk/pdisk.c        Tue Apr 22 17:04:06 2003 +0000
@@ -647,8 +647,8 @@
 {
     long base;
     long length;
-    char *name;
-    char *type_name;
+    char *name = 0;
+    char *type_name = 0;
 
     if (map == NULL) {
        bad_input("No partition map exists");
@@ -697,9 +697,11 @@
 #endif
     }
 xit2:
-    free(type_name);
+    if (type_name)
+        free(type_name);
 xit1:
-    free(name);
+    if (name)
+        free(name);
     return;
 }
 



Home | Main Index | Thread Index | Old Index