svn commit: samba r7759 - in branches/SAMBA_4_0/source/lib/ldb/common: .

Andrew Tridgell tridge at osdl.org
Tue Jun 21 22:55:08 GMT 2005


Derrell,

 > Shouldn't this be talloc_strdup("ldb not connected")?  The error string from
 > some modules is likely to have to be allocated, as it may be coming,
 > initially, from an external library which malloc()s it, so the string will
 > have to be talloc_strdup()ed to be returned. (e.g. sqlite).

No. The caller does not free in this API. It's fine for a backend to
allocate the string, in which case the backend will need to do
something like this:

  talloc_free(mybackend->last_error_string);
  mybackend->last_error_string = talloc_strdup(mybackend, "a new error");
  return mybackend->last_error_string;

Cheers, Tridge


More information about the samba-technical mailing list