Skip to content

Commit

Permalink
Merge branch 'zero-mem-on-malloc'
Browse files Browse the repository at this point in the history
  • Loading branch information
jcupitt committed Jan 18, 2019
2 parents 4cbc280 + 0062242 commit dcba364
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion ChangeLog
Expand Up @@ -21,7 +21,10 @@
- add @reduction_effort param to webpsave [lovell]

4/1/19 started 8.7.4
- fix memory leak in magickload [kleisauke]
- magickload with magick6 API did not chain exceptions correctly causing a
memory leak under some conditions [kleisauke]
- zero memory on allocate to prevent write of uninitialized memory under some
error conditions [Balint Varga-Perke]

21/11/18 started 8.7.3
- fix infinite loop for autofit with non-scaleable font
Expand Down
4 changes: 2 additions & 2 deletions libvips/iofuncs/memory.c
Expand Up @@ -173,7 +173,7 @@ vips_malloc( VipsObject *object, size_t size )
{
void *buf;

buf = g_malloc( size );
buf = g_malloc0( size );

if( object ) {
g_signal_connect( object, "postclose",
Expand Down Expand Up @@ -317,7 +317,7 @@ vips_tracked_malloc( size_t size )
*/
size += 16;

if( !(buf = g_try_malloc( size )) ) {
if( !(buf = g_try_malloc0( size )) ) {
#ifdef DEBUG
g_assert_not_reached();
#endif /*DEBUG*/
Expand Down

3 comments on commit dcba364

@jcupitt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kleisauke could you mail me on jcupitt@gmail.com about this change? Sorry, I don't seem to have your email address :-(

@kleisauke
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcupitt Did you mean this change?

@jcupitt
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, the gmalloc0 one (should be above).

Please sign in to comment.