Author: gonzo
Date: Thu May 19 20:51:47 2016
New Revision: 300230
URL: https://svnweb.freebsd.org/changeset/base/300230

Log:
  Fixed memory leak in FDT overlay handling code
  
  Free both overlay and new fdt before returning after fdt_open_into error
  PR:           209634
  Submitted by: David Binderman

Modified:
  head/sys/boot/fdt/fdt_loader_cmd.c

Modified: head/sys/boot/fdt/fdt_loader_cmd.c
==============================================================================
--- head/sys/boot/fdt/fdt_loader_cmd.c  Thu May 19 20:08:16 2016        
(r300229)
+++ head/sys/boot/fdt/fdt_loader_cmd.c  Thu May 19 20:51:47 2016        
(r300230)
@@ -383,6 +383,8 @@ fdt_apply_overlays()
        rv = fdt_open_into(fdtp, new_fdtp, new_fdtp_size);
        if (rv != 0) {
                printf("failed to open DTB blob for applying overlays\n");
+               free(new_fdtp);
+               free(overlay);
                return;
        }
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to