Changeset 12


Ignore:
Timestamp:
Mar 25, 2007, 1:38:38 PM (18 years ago)
Author:
Yuri Dario
Message:

Use lowmem buffer for DosEnumAttribute.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba-3.0.25pre1/source/lib/os2ea.c

    r2 r12  
    1616#include <errno.h>
    1717#include <types.h>
     18
     19//YD for tmalloc
     20#include <malloc.h>
     21
    1822#ifndef TESTING
    1923#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
     
    242246                return 0;
    243247        }
    244         buf = (char *)malloc(stat.cbList * 2);
     248        //YD DosEnumAttribute doesn't like high-mem buffers, get a low one.
     249        buf = (char *)_tmalloc(stat.cbList * 2);
    245250        rc = DosEnumAttribute(path ? 1 : 0, path ? (PVOID)path : (PVOID)&file, 1, (PVOID)buf, stat.cbList * 2, &ulCount, 1);
    246251        if (rc)
     
    248253                DEBUG(4,("unilistxattr2 : (%s:%d) %d\n", path ? path : "null", file, rc));
    249254                maperrno(rc);
    250                 free(buf);
     255                _tfree(buf);
    251256                return -1;
    252257        }
     
    269274                }
    270275        }
    271         free(buf);
     276        _tfree(buf);
    272277        DEBUG(4,("unilistxattr : (%s:%d) %d\n", path ? path : "null", file, gotsize));
    273278        if (gotsize > size)
     
    371376        }
    372377
    373         totalsize = sizeof(GEALIST) + size + namelen + 1;
     378        totalsize = sizeof(FEA2LIST) + size + namelen + 1;
    374379
    375380        pfea2list = (PFEA2LIST)calloc(totalsize, 1);
Note: See TracChangeset for help on using the changeset viewer.