[libbluray-devel] Replace missed realloc with _safe_realloc.

Petri Hintukainen phintuka at users.sourceforge.net
Tue May 30 18:40:48 CEST 2017


ti, 2017-05-30 kello 18:07 +0200, Andreas Zelend kirjoitti:
> This does not work, sorry! _safe_realloc is not defined in this file.

Yes... and realloc() is OK here, there's no leak even if realloc fails.

> 2017-05-30 17:35 GMT+02:00 ace20022 <git at videolan.org>:
> > libudfread | branch: master | ace20022 <ace20022 at ymail.com> | Tue
> > May 30 14:00:26 2017 +0200|
> > [4cbdf4412bc4a781ef2cce04e1a7f93286753a23] | committer: Petri
> > Hintukainen
> > 
> > Replace missed realloc with _safe_realloc.
> > 
> > > http://git.videolan.org/gitweb.cgi/libudfread.git/?a=commit;h=4cb
> > df4412bc4a781ef2cce04e1a7f93286753a23
> > ---
> > 
> >  src/ecma167.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/ecma167.c b/src/ecma167.c
> > index 814e7af..2a3f60e 100644
> > --- a/src/ecma167.c
> > +++ b/src/ecma167.c
> > @@ -341,7 +341,7 @@ int decode_allocation_extent(struct file_entry
> > **p_fe, const uint8_t *p, size_t
> >          return 0;
> >      }
> > 
> > -    fe = (struct file_entry *)realloc(fe, sizeof(struct
> > file_entry) + sizeof(struct long_ad) * (fe->num_ad + num_ad - 1));
> > +    fe = (struct file_entry *)_safe_realloc(fe, sizeof(struct
> > file_entry) + sizeof(struct long_ad) * (fe->num_ad + num_ad - 1));
> >      if (!fe) {
> >          return -1;
> >      }
> > 
> > _______________________________________________
> > libbluray-devel mailing list
> > libbluray-devel at videolan.org
> > https://mailman.videolan.org/listinfo/libbluray-devel
> > 
> 
> _______________________________________________
> libbluray-devel mailing list
> libbluray-devel at videolan.org
> https://mailman.videolan.org/listinfo/libbluray-devel


More information about the libbluray-devel mailing list