Fritjof Bornebusch <[email protected]> writes:

> Hi tech,
>
> if ci uses a user defined revision number the pointer was just set to NULL 
> and not freed correctly.

Makes sense to me, ok?

I'll probably commit tomorrow if I hear no objection.

> fritjof
>
> Index: ci.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/rcs/ci.c,v
> retrieving revision 1.216
> diff -u -p -r1.216 ci.c
> --- ci.c        27 Oct 2013 18:31:24 -0000      1.216
> +++ ci.c        10 May 2014 15:30:51 -0000
> @@ -287,7 +287,6 @@ checkin_main(int argc, char **argv)
>                         (void)fprintf(stderr,
>                             "%s  <--  %s\n", pb.fpath, pb.filename);
>  
> -               /* XXX - Should we rcsnum_free(pb.newrev)? */
>                 if (rev_str != NULL)
>                         if ((pb.newrev = rcs_getrevnum(rev_str, pb.file)) ==
>                             NULL)
> @@ -315,6 +314,8 @@ checkin_main(int argc, char **argv)
>                 }
>  
>                 rcs_close(pb.file);
> +               if (rev_str != NULL)
> +                       rcsnum_free(pb.newrev);
>                 pb.newrev = NULL;
>         }
>

-- 
jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF  DDCC 0DFA 74AE 1524 E7EE

Reply via email to