source: patches/bc-1.06.95-memory_leak-1.patch@ 28d5047

systemd
Last change on this file since 28d5047 was 09c0ac7, checked in by William Harrington <kb0iic@…>, 9 years ago

Add the Bc memory leak check patch.

  • Property mode set to 100644
File size: 1.4 KB
  • bc-1.06.95

    Submitted By: Bruce Dubbs (bdubbs at linuxfromscratch dot org)
    Date: 2014-04-18
    Initial Package Version: 1.06.95
    Origin: Gentoo
    Description: Fixes memory leaks and an uninitialized variable
     
    diff -Naur bc-1.06.95.orig/bc/bc.y bc-1.06.95/bc/bc.y
    old new  
    569569                                    generate (">");
    570570                                  break;
    571571                                }
     572                                free($2);       
    572573                            }
    573574                        | expression '+' expression
    574575                            {
  • bc/storage.c

    diff -Naur bc-1.06.95.orig/bc/storage.c bc-1.06.95/bc/storage.c
    old new  
    9999    {
    100100      f = &functions[indx];
    101101      f->f_defined = FALSE;
     102      f->f_void = FALSE;
    102103      f->f_body = (char *) bc_malloc (BC_START_SIZE);
    103104      f->f_body_size = BC_START_SIZE;
    104105      f->f_code_size = 0;
  • bc/util.c

    diff -Naur bc-1.06.95.orig/bc/util.c bc-1.06.95/bc/util.c
    old new  
    602602    case FUNCTDEF:
    603603      if (id->f_name != 0)
    604604        {
    605           if (namekind != FUNCT)
    606             free(name);
     605          free(name);
    607606          /* Check to see if we are redefining a math lib function. */
    608607          if (use_math && namekind == FUNCTDEF && id->f_name <= 6)
    609608            id->f_name = next_func++;
Note: See TracBrowser for help on using the repository browser.