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

[Nbd] freeing a non-malloc'ed string



In nbd-server.c, auth_file is not malloc'ed but it is freed, causing a
segfault (depending on how lucky you are) when the -l option is used.
Removing the line that says free(auth_file) fixes the problem.

Index: nbd-server.c
===================================================================
RCS file: /cvsroot/nbd/nbd/nbd-server.c,v
retrieving revision 1.31
diff -u -r1.31 nbd-server.c
--- nbd-server.c	27 Jun 2004 11:34:55 -0000	1.31
+++ nbd-server.c	18 Jul 2004 21:38:42 -0000
@@ -310,7 +310,6 @@
 			case 'c': flags |=F_COPYONWRITE;
 			        break;
 			case 'l':
-				free(auth_file);
 				if (i+1<argc) {
 					auth_file=argv[++i];
 				} else {



Reply to: