Changeset 4564


Ignore:
Timestamp:
07/30/08 16:01:54 (5 years ago)
Author:
tick
Message:

opkg: fix the crashing issue.

It's a hanging pointer.
Using installed_files without get and free

Location:
trunk/src/target/opkg/libopkg
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/opkg/libopkg/pkg.c

    r4563 r4564  
    17381738               file_hash_set_file_owner(conf, installed_file, pkg); 
    17391739          } 
    1740           //FIXME: mark this line. Thid avoid crash, But the reference count shall be balanced. (If there are some delay after file_hash_set_file_owner, it wont crash (Pondering why?)) 
    1741           //pkg_free_installed_files(pkg); 
     1740          pkg_free_installed_files(pkg); 
    17421741     } 
    17431742     pkg_vec_free(installed_pkgs); 
  • trunk/src/target/opkg/libopkg/pkg_hash.c

    r4474 r4564  
    649649     hash_table_insert(file_hash, file_name, owning_pkg);  
    650650     if (old_owning_pkg) { 
     651          pkg_get_installed_files(old_owning_pkg); 
    651652          str_list_remove_elt(old_owning_pkg->installed_files, file_name); 
     653          pkg_free_installed_files(old_owning_pkg); 
    652654          /* mark this package to have its filelist written */ 
    653655          old_owning_pkg->state_flag |= SF_FILELIST_CHANGED; 
    654656          owning_pkg->state_flag |= SF_FILELIST_CHANGED; 
     657           
    655658     } 
    656659     return 0; 
  • trunk/src/target/opkg/libopkg/void_list.c

    r4357 r4564  
    160160     void_list_elt_t *old_elt = NULL; 
    161161     void *old_data = NULL; 
     162 
     163     if (!list) { 
     164          fprintf(stderr, "Error: void_list_remove_elt list is NULL\n"); 
     165          return NULL; 
     166     } 
     167     if (!target_data) { 
     168          fprintf(stderr, "Error: void_list_remove_elt target_data is NULL\n"); 
     169          return NULL; 
     170     } 
    162171 
    163172     /* first element */ 
Note: See TracChangeset for help on using the changeset viewer.