return +1;
}
- if (!push_ucs2_allocate(&buffer_s, ps, &size)) {
+ if (!push_ucs2_talloc(NULL, &buffer_s, ps, &size)) {
return strcmp(ps, pt);
/* Not quite the right answer, but finding the right one
under this failure case is expensive, and it's pretty
close */
}
- if (!push_ucs2_allocate(&buffer_t, pt, &size)) {
- SAFE_FREE(buffer_s);
+ if (!push_ucs2_talloc(NULL, &buffer_t, pt, &size)) {
+ TALLOC_FREE(buffer_s);
return strcmp(ps, pt);
/* Not quite the right answer, but finding the right one
under this failure case is expensive, and it's pretty
}
ret = strcasecmp_w(buffer_s, buffer_t);
- SAFE_FREE(buffer_s);
- SAFE_FREE(buffer_t);
+ TALLOC_FREE(buffer_s);
+ TALLOC_FREE(buffer_t);
return ret;
}
return 0;
}
- if (!push_ucs2_allocate(&buffer_s, ps, &size)) {
+ if (!push_ucs2_talloc(NULL, &buffer_s, ps, &size)) {
return strncmp(ps, pt, len-n);
/* Not quite the right answer, but finding the right one
under this failure case is expensive,
and it's pretty close */
}
- if (!push_ucs2_allocate(&buffer_t, pt, &size)) {
- SAFE_FREE(buffer_s);
+ if (!push_ucs2_talloc(NULL, &buffer_t, pt, &size)) {
+ TALLOC_FREE(buffer_s);
return strncmp(ps, pt, len-n);
/* Not quite the right answer, but finding the right one
under this failure case is expensive,
}
ret = strncasecmp_w(buffer_s, buffer_t, len-n);
- SAFE_FREE(buffer_s);
- SAFE_FREE(buffer_t);
+ TALLOC_FREE(buffer_s);
+ TALLOC_FREE(buffer_t);
return ret;
}
{
size_t ret, converted_size;
smb_ucs2_t *tmpbuf2 = NULL;
- if (!push_ucs2_allocate(&tmpbuf2, s, &converted_size)) {
+ if (!push_ucs2_talloc(NULL, &tmpbuf2, s, &converted_size)) {
return 0;
}
ret = strlen_w(tmpbuf2);
- SAFE_FREE(tmpbuf2);
+ TALLOC_FREE(tmpbuf2);
return ret;
}
{
size_t ret, converted_size;
char *tmpbuf2 = NULL;
- if (!push_ascii_allocate(&tmpbuf2, s, &converted_size)) {
+ if (!push_ascii_talloc(NULL, &tmpbuf2, s, &converted_size)) {
return 0;
}
ret = strlen(tmpbuf2);
- SAFE_FREE(tmpbuf2);
+ TALLOC_FREE(tmpbuf2);
return ret;
}
bool ret;
size_t converted_size;
- if (!push_ucs2_allocate(&tmp, s, &converted_size)) {
+ if (!push_ucs2_talloc(NULL, &tmp, s, &converted_size)) {
return false;
}
}
ret = (*p != 0);
- SAFE_FREE(tmp);
+ TALLOC_FREE(tmp);
return ret;
}
bool ret;
size_t converted_size;
- if (!push_ucs2_allocate(&tmp, s, &converted_size)) {
+ if (!push_ucs2_talloc(NULL, &tmp, s, &converted_size)) {
return false;
}
}
ret = (*p != 0);
- SAFE_FREE(tmp);
+ TALLOC_FREE(tmp);
return ret;
}
s = src;
#endif
- if (!push_ucs2_allocate(&ws, s, &converted_size)) {
+ if (!push_ucs2_talloc(NULL, &ws, s, &converted_size)) {
/* Wrong answer, but what can we do... */
return strchr(src, c);
}
p = strchr_w(ws, UCS2_CHAR(c));
if (!p) {
- SAFE_FREE(ws);
+ TALLOC_FREE(ws);
return NULL;
}
*p = 0;
- if (!pull_ucs2_allocate(&s2, ws, &converted_size)) {
+ if (!pull_ucs2_talloc(NULL, &s2, ws, &converted_size)) {
SAFE_FREE(ws);
/* Wrong answer, but what can we do... */
return strchr(src, c);
}
ret = (char *)(s+strlen(s2));
- SAFE_FREE(ws);
- SAFE_FREE(s2);
+ TALLOC_FREE(ws);
+ TALLOC_FREE(s2);
return ret;
}
char *ret;
size_t converted_size;
- if (!push_ucs2_allocate(&ws, s, &converted_size)) {
+ if (!push_ucs2_talloc(NULL, &ws, s, &converted_size)) {
/* Wrong answer, but what can we do. */
return strrchr(s, c);
}
p = strrchr_w(ws, UCS2_CHAR(c));
if (!p) {
- SAFE_FREE(ws);
+ TALLOC_FREE(ws);
return NULL;
}
*p = 0;
- if (!pull_ucs2_allocate(&s2, ws, &converted_size)) {
- SAFE_FREE(ws);
+ if (!pull_ucs2_talloc(NULL, &s2, ws, &converted_size)) {
+ TALLOC_FREE(ws);
/* Wrong answer, but what can we do. */
return strrchr(s, c);
}
ret = (char *)(s+strlen(s2));
- SAFE_FREE(ws);
- SAFE_FREE(s2);
+ TALLOC_FREE(ws);
+ TALLOC_FREE(s2);
return ret;
}
}
char *ret;
size_t converted_size;
- if (!push_ucs2_allocate(&ws, s, &converted_size)) {
+ if (!push_ucs2_talloc(NULL, &ws, s, &converted_size)) {
/* Too hard to try and get right. */
return NULL;
}
p = strnrchr_w(ws, UCS2_CHAR(c), n);
if (!p) {
- SAFE_FREE(ws);
+ TALLOC_FREE(ws);
return NULL;
}
*p = 0;
- if (!pull_ucs2_allocate(&s2, ws, &converted_size)) {
- SAFE_FREE(ws);
+ if (!pull_ucs2_talloc(NULL, &s2, ws, &converted_size)) {
+ TALLOC_FREE(ws);
/* Too hard to try and get right. */
return NULL;
}
ret = (char *)(s+strlen(s2));
- SAFE_FREE(ws);
- SAFE_FREE(s2);
+ TALLOC_FREE(ws);
+ TALLOC_FREE(s2);
return ret;
}
s = src;
#endif
- if (!push_ucs2_allocate(&src_w, src, &converted_size)) {
+ if (!push_ucs2_talloc(NULL, &src_w, src, &converted_size)) {
DEBUG(0,("strstr_m: src malloc fail\n"));
return NULL;
}
- if (!push_ucs2_allocate(&find_w, findstr, &converted_size)) {
- SAFE_FREE(src_w);
+ if (!push_ucs2_talloc(NULL, &find_w, findstr, &converted_size)) {
+ TALLOC_FREE(src_w);
DEBUG(0,("strstr_m: find malloc fail\n"));
return NULL;
}
p = strstr_w(src_w, find_w);
if (!p) {
- SAFE_FREE(src_w);
- SAFE_FREE(find_w);
+ TALLOC_FREE(src_w);
+ TALLOC_FREE(find_w);
return NULL;
}
*p = 0;
- if (!pull_ucs2_allocate(&s2, src_w, &converted_size)) {
- SAFE_FREE(src_w);
- SAFE_FREE(find_w);
+ if (!pull_ucs2_talloc(NULL, &s2, src_w, &converted_size)) {
+ TALLOC_FREE(src_w);
+ TALLOC_FREE(find_w);
DEBUG(0,("strstr_m: dest malloc fail\n"));
return NULL;
}
retp = (char *)(s+strlen(s2));
- SAFE_FREE(src_w);
- SAFE_FREE(find_w);
- SAFE_FREE(s2);
+ TALLOC_FREE(src_w);
+ TALLOC_FREE(find_w);
+ TALLOC_FREE(s2);
return retp;
}