Ignore:
Timestamp:
06/21/13 11:30:10 (10 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Fixed two memory leaks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/orange/lib_kernel.cpp

    r11001 r11603  
    21812181    for(pe = pi; *pe && *pe != sep; pe++); 
    21822182    const int plen = pe-pi; 
    2183     char *npath = strncpy(new char[plen+flen+2], pi, pe-pi); 
     2183    char *npath = new char[plen + flen + 2]; 
     2184    strncpy(npath, pi, pe - pi); 
    21842185    if (!plen || (pi[plen] != pathsep)) { 
    21852186      npath[plen] = pathsep; 
     
    21902191    } 
    21912192    PyObject *res = loadDataFromFileNoSearch(type, npath, argstuple, keywords, generatorOnly); 
     2193    delete[] npath; 
     2194 
    21922195    PyErr_Clear(); 
    21932196    if (res) { 
Note: See TracChangeset for help on using the changeset viewer.