summaryrefslogtreecommitdiffstats
path: root/source/lib/talloc.c
Commit message (Collapse)AuthorAgeFilesLines
* Finish adding strings to all talloc_init() calls.Jeremy Allison2002-12-231-1/+0
| | | | Jeremy.
* Forward port the change to talloc_init() to make all talloc contextsJeremy Allison2002-12-201-3/+3
| | | | | named. Ensure we can query them. Jeremy.
* The name pointer in the talloc context must not be a talloced entry asJeremy Allison2002-12-141-2/+13
| | | | | calling talloc_destroy_pool(as we do sometimes) will destroy it. Jeremy.
* used findstatic.pl to make some variables static and remove some deadAndrew Tridgell2002-07-011-1/+1
| | | | code
* put the ifdef for HAVE_VA_COPY in one place rather than in lots ofAndrew Tridgell2002-06-031-16/+7
| | | | functions
* Add __va_copy to talloc functions. talloc_asprintf was causing all kindsJim McDonough2002-05-161-5/+24
| | | | of problems on Linux/390 systems...
* Partly based on the work by mimir (Rafal SzczesniakAndrew Bartlett2002-04-141-0/+9
| | | | | | | | | | | | | | <mimir@diament.ists.pwr.wroc.pl>) this patch allows samba to correctly enumerate its trusted domains - by exaimining the keys in the secrets.tdb file. This patch has been tested with both NT4 and rpcclient/wbinfo, and adds some extra functionality to talloc and rpc_parse to allow it to deal with already unicode strings. Finally, this cleans up some const warnings that were in net_rpc.c by pushing another dash of const into the rpc client code. Andrew Bartlett
* more verbose checking in talloc and util_pwSimo Sorce2002-03-181-39/+49
| | | | | fixed tdbsam memory corruption (and segfault) reducing calls to pdb_uid_to_user_rid and countrary to 0 to move to a non alghoritmic rid allocation with some passdb modules.
* getpid() -> sys_getpid()Tim Potter2002-03-141-1/+1
|
* Fix typo.Martin Pool2002-03-101-1/+1
|
* Removed version number from file header.Tim Potter2002-01-301-1/+1
| | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header.
* picky about reallocJean-François Micouleau2002-01-251-5/+6
| | | | J.F.
* FIXME We should turn the global list off when using Insure++,Martin Pool2002-01-141-0/+3
| | | | otherwise all the memory will be seen as still reachable.
* Cope nicely with pools with no name.Martin Pool2002-01-031-1/+10
|
* talloc accounting now includes number of chunks and bytes allocated.Martin Pool2002-01-031-9/+42
|
* Add talloc_asprintf_append, which grows an existing string buffer toMartin Pool2002-01-031-4/+76
| | | | | contain new print-formatted information. (Also talloc_vasprintf_append.) Idea borrowed from glib.
* Add --enable-dmalloc to link against the dmalloc malloc debugger.Martin Pool2001-12-201-1/+7
| | | | | It's not as strong as Insure, but it's free, reasonably efficient and works on every platform.
* Make TALLOC_CTX and talloc_chunk private to talloc.c.Martin Pool2001-12-191-4/+74
| | | | | | | | | | Add a global singly-linked list of all active talloc pools, so that we can eventually show how much memory is used for different purposes. This also gives a check that pools are not being doubly freed. talloc_init_named now handle a NULL name properly (ie does nothing) Add accessor talloc_pool_name().
* DocMartin Pool2001-12-191-8/+12
|
* DocMartin Pool2001-12-191-1/+7
|
* Put PRINTF_ATTRIBUTE on talloc_init_named, talloc_asprintf,Martin Pool2001-12-191-3/+3
| | | | talloc_vasprintf.
* Doc.Martin Pool2001-12-191-0/+6
|
* Start adding some debugging features to talloc based on Samba'sMartin Pool2001-12-191-7/+38
| | | | | | | | | | ancient mem_man.c: Each TALLOC_CTX now has a field to store its purpose, to aid in tracking down memory bloat. A new call talloc_init_named() should be used instead of talloc_init() so that this is set. Added talloc_vasprintf to be called by varargs functions.
* fixed an off by 1 bug in talloc_asprintf()Andrew Tridgell2001-12-051-1/+1
|
* const religion in talloc callsAndrew Tridgell2001-12-041-2/+2
|
* return of vsnprintf doesn't include terminationAndrew Tridgell2001-10-141-1/+1
| | | | thanks to simo for spotting this
* bit neater talloc_asprintf() implementationAndrew Tridgell2001-10-141-19/+11
|
* introduce mangle backward compatibility functionsSimo Sorce2001-10-131-0/+31
| | | | add talloc_asprintf()
* move to SAFE_FREE()Simo Sorce2001-09-171-5/+4
|
* Change all realloc() statements to Realloc() (ecxept for tdb.c)Simo Sorce2001-08-081-1/+1
| | | | | | | changed some code to exploit the fact that Realloc(NULL, size) == malloc(size) fixed some possible mem leaks, or seg faults. thanks to andreas moroder (mallocs not checked in client/client.c, client/smbumount.c)
* Made talloc_realloc() semantics match realloc(). JF was complaining :-).Jeremy Allison2001-07-021-0/+8
| | | | | realloc(NULL) == malloc. realloc(p,0) == free() - a no-op in talloc. Jeremy.
* Spelling fix.Tim Potter2001-06-221-1/+1
|
* the BAD_PTR idea in talloc.h is actually a bad idea - it means callers have ↵Andrew Tridgell2001-06-221-7/+1
| | | | no way of telling if the call really failed
* Added talloc_strdup() funcion.Tim Potter2001-05-111-0/+6
|
* Added Gerald's fixes.Jeremy Allison2001-03-231-1/+0
| | | | Jeremy.
* a much simpler talloc() implementation. This version has the followingAndrew Tridgell2001-03-231-29/+36
| | | | | | | | | | | | | advantages: - memory is trackable by insure - a very simple talloc_realloc() is possible (I've added it) It is slower than the previous talloc code, but I don't think that is going to be a problem. If it is a problem then there are some ways we can make it faster but I'd like to leave those until we have tested this a bit and can see what performance problems might show up in profiling
* Move to talloc control of SPOOL_XXX structs. Move to talloc control ofJeremy Allison2001-02-281-0/+13
| | | | | security descriptors and pointers. Syncup with 2.2 tree. Jeremy.
* Added total memory allocated counter to talloc, so we can tell if a tallocJeremy Allison2001-02-271-0/+22
| | | | | | | pool is getting bloated. Also added a talloc_zero function to return zeroed memory. Added debug in rpc_server/srv_pipe_hnd.c so we know when a talloc pool is being freed. Syncup with srv_pipe_hnd.c from 2.2 so we are freeing memory at the same time. Jeremy.
* Fixed memory leaks in lsa_XX calls. Fixed memory leaks in smbcacls. MergedJeremy Allison2000-12-151-0/+5
| | | | | | in fixes from appliance-head and 2.2. Fixed multiple connection.tdb open problem. Jeremy.
* reworked talloc() to in order to help track down invalidGerald Carter2000-08-121-25/+26
| | | | | | | | | | | | | | | | | memory access. Tridge, I don't think using 0xdeadbeef for size allocations of 0 is going to work. I ended up having to use NULL as much code that works on UNISTR checks to see if the buffer ptr is NULL. So valid code ends up with a seg fault. Rather than rewriting it all, I added a DEBUG_TALLOC #ifdef in talloc.h that sets a macro BAD_PTR. This is the value assigned to ptr for an allocation of 0 bytes. jerry
* talloc returns 0xdeadbeef when asked to allocate 0 bytesGerald Carter2000-08-101-19/+29
| | | | jerry
* Ok - this is a *BIG* change - but it fixes the problems with static stringsJeremy Allison2000-07-271-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | in the RPC code. This change was prompted by trying to save a long (>256) character comment in the printer properties page. The new system associates a TALLOC_CTX with the pipe struct, and frees the pool on return of a complete PDU. A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx code, and is freed in the main loop. This code works with insure, and seems to be free of memory leaks and crashes (so far) but there are probably the occasional problem with code that uses UNISTRxx structs on the stack and expects them to contain storage without doing a init_unistrXX(). This means that rpcclient will probably be horribly broken. A TALLOC_CTX also needed associating with the struct cli_state also, to make the prs_xx code there work. The main interface change is the addition of a TALLOC_CTX to the prs_init calls - used for dynamic allocation in the prs_XXX calls. Now this is in place it should make dynamic allocation of all RPC memory on unmarshall *much* easier to fix. Jeremy.
* fixed size alignment in tallocAndrew Tridgell2000-06-261-2/+2
|
* Fixed pointer arithmetic found by IRIX compiler.Jeremy Allison2000-01-111-1/+1
| | | | Jeremy.
* implemented talloc() as described on samba-technical. This fixes theAndrew Tridgell2000-01-051-0/+96
lp_string() bug properly. we still need to add lp_talloc_free() calls in all the main event loops, I've only put it in smbd and nmbd thus far.