[specimen] PATCH: keep New item from wiping out your existing bank

Juuso Alasuutari juuso.alasuutari at gmail.com
Thu Nov 15 01:51:48 CST 2007


On Thursday 15 November 2007 06:51:51 Ken Restivo wrote:
> It looks like a patch I submitted a while ago still isn't in SVN.
>
> It's kind of critical. If you don't have the fix, then if you choose New
> from the File menu to create a new bank, and then Save to save it, your
> existing saved bank will be wiped out completely off of your disk!
>
> I found this out the hard way earlier this year. I was going to try out the
> svn version of specimen but had to add this back in.
>
> -ken
> -----------
> --- specimen-0.5.2.rc3.orig/src/gui/bank-ops.c
> +++ specimen-0.5.2.rc3/src/gui/bank-ops.c
> @@ -140,5 +140,6 @@
>  int bank_ops_new ( )
>  {
>       patch_destroy_all ( );
> +    last_bank = strdup ("\0");
>       return 0;
>  }

Hi,

Thanks for the reminder. I don't remember hearing about this bug, but it sure 
sounds like a nasty one.

I didn't have a look at the surrounding code yet so I might be talking out of 
my ass, but your patch looks like it introduces a mem leak. Gotta be careful 
with strdup(). Or is last_bank properly freed at some point before calling 
bank_ops_new()?

I'll use this opportunity to poke Eric and myself about finally getting 
finally out. The current code in SVN is, small discoveries such as this bug 
aside, more or less ready for that purpose.

Juuso

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




More information about the Specimen mailing list