Subject: Re: BSD licensed compress/gzip for NetBSD
To: None <netbsd@bjan.freeshell.org>
From: Jun-ichiro itojun Hagino <itojun@itojun.org>
List: current-users
Date: 02/24/2004 14:41:49
> --- /usr/home/bjan/Hacking/obsd/compress/main.c	2004-01-22 19:31:00.000000000 -0700
> +++ main.c	2004-02-23 15:57:08.000000000 -0700
> @@ -449,7 +449,7 @@
>  }
>  
>  int
> -docompress(const char *in, char *out, const struct compressor *method,
> +docompress(const char *_in, char *out, const struct compressor *method,
>      int bits, struct stat *sb)
>  {
>  	u_char buf[Z_BUFSIZE];
> @@ -459,6 +459,7 @@
>  	ssize_t nr;
>  	u_int32_t mtime;
>  	struct z_info info;
> +	char *in;
>  
>  	mtime = 0;
>  	flags = 0;
> @@ -466,6 +467,8 @@
>  	name = NULL;
>  	cookie  = NULL;
>  
> +	in = strdup(_in);
> +
>  	if ((ifd = open(in, O_RDONLY)) < 0) {
>  		if (verbose >= 0)
>  			warn("%s", out);

	memory leak?

itojun