mirror of
https://github.com/samba-team/samba.git
synced 2025-02-23 09:57:40 +03:00
werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source3/utils/
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
9c164efe2a
commit
b00f30c0ac
@ -258,7 +258,7 @@ static WERROR regedit_search(struct regedit *regedit, struct tree_node *node,
|
||||
save_value_name = talloc_strdup(regedit,
|
||||
it->value_name);
|
||||
if (save_value_name == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -345,7 +345,7 @@ WERROR dialog_create(struct dialog *dia)
|
||||
ncols += 6;
|
||||
dia->pad = newpad(nlines, ncols);
|
||||
if (dia->pad == NULL) {
|
||||
rv = WERR_NOMEM;
|
||||
rv = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto fail;
|
||||
}
|
||||
dia->centered = false;
|
||||
@ -355,12 +355,12 @@ WERROR dialog_create(struct dialog *dia)
|
||||
}
|
||||
dia->window = newwin(nlines, ncols, dia->y, dia->x);
|
||||
if (dia->window == NULL) {
|
||||
rv = WERR_NOMEM;
|
||||
rv = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto fail;
|
||||
}
|
||||
dia->panel = new_panel(dia->window);
|
||||
if (dia->panel == NULL) {
|
||||
rv = WERR_NOMEM;
|
||||
rv = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
@ -398,7 +398,7 @@ WERROR dialog_create(struct dialog *dia)
|
||||
section->window = subpad(dia->pad, section->nlines,
|
||||
section->ncols, row, col);
|
||||
if (section->window == NULL) {
|
||||
rv = WERR_NOMEM;
|
||||
rv = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto fail;
|
||||
}
|
||||
SMB_ASSERT(section->ops->create != NULL);
|
||||
@ -742,14 +742,14 @@ static WERROR text_field_create(struct dialog *dia,
|
||||
text_field->field[0] = new_field(section->nlines, section->ncols,
|
||||
0, 0, 0, 0);
|
||||
if (text_field->field[0] == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
set_field_back(text_field->field[0], A_REVERSE);
|
||||
set_field_opts(text_field->field[0], text_field->opts);
|
||||
|
||||
text_field->form = new_form(text_field->field);
|
||||
if (text_field->form == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
set_form_win(text_field->form, dia->window);
|
||||
@ -986,7 +986,7 @@ WERROR dialog_section_text_field_set_lines(TALLOC_CTX *ctx,
|
||||
talloc_array_length(buf) +
|
||||
length + padding + 1);
|
||||
if (buf == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
memcpy(&buf[idx], *arrayp, length);
|
||||
idx += length;
|
||||
@ -1066,7 +1066,7 @@ static WERROR hexedit_create(struct dialog *dia,
|
||||
hexedit->buf = hexedit_new(dia, section->window, NULL,
|
||||
HEXEDIT_MIN_SIZE);
|
||||
if (hexedit->buf == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
hexedit_refresh(hexedit->buf);
|
||||
@ -1912,7 +1912,7 @@ static WERROR fill_value_buffer(struct dialog *dia, struct edit_req *edit)
|
||||
}
|
||||
tmp = talloc_asprintf(dia, "%u", (unsigned)v);
|
||||
if (tmp == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
dialog_section_text_field_set(data, tmp);
|
||||
talloc_free(tmp);
|
||||
@ -1923,7 +1923,7 @@ static WERROR fill_value_buffer(struct dialog *dia, struct edit_req *edit)
|
||||
const char *s;
|
||||
|
||||
if (!pull_reg_sz(dia, &edit->vitem->data, &s)) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
dialog_section_text_field_set(data, s);
|
||||
break;
|
||||
@ -1932,7 +1932,7 @@ static WERROR fill_value_buffer(struct dialog *dia, struct edit_req *edit)
|
||||
const char **array;
|
||||
|
||||
if (!pull_reg_multi_sz(dia, &edit->vitem->data, &array)) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
return dialog_section_text_field_set_lines(dia, data, array);
|
||||
}
|
||||
@ -2018,7 +2018,7 @@ static bool edit_on_submit(struct dialog *dia, struct dialog_section *section,
|
||||
|
||||
buf = dialog_section_text_field_get(dia, data);
|
||||
if (!buf || !push_reg_sz(dia, &blob, buf)) {
|
||||
rv = WERR_NOMEM;
|
||||
rv = WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -2027,7 +2027,7 @@ static bool edit_on_submit(struct dialog *dia, struct dialog_section *section,
|
||||
|
||||
lines = dialog_section_text_field_get_lines(dia, data);
|
||||
if (!lines || !push_reg_multi_sz(dia, &blob, lines)) {
|
||||
rv = WERR_NOMEM;
|
||||
rv = WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ WERROR hexedit_set_buf(struct hexedit *buf, const void *data, size_t sz)
|
||||
|
||||
buf->data = talloc_zero_array(buf, uint8_t, sz);
|
||||
if (buf->data == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
if (data != NULL) {
|
||||
@ -549,7 +549,7 @@ WERROR hexedit_resize_buffer(struct hexedit *buf, size_t newsz)
|
||||
d = talloc_realloc(buf, buf->data, uint8_t,
|
||||
buf->alloc_size);
|
||||
if (d == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
buf->data = d;
|
||||
}
|
||||
|
@ -261,7 +261,7 @@ static WERROR put_data(struct multilist *list)
|
||||
SMB_ASSERT(item != NULL);
|
||||
tmp = talloc_asprintf(list, "%s%s", prefix, item);
|
||||
if (tmp == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
put_item(list, list->pad, col, tmp, 0);
|
||||
talloc_free(tmp);
|
||||
@ -384,7 +384,7 @@ WERROR multilist_set_data(struct multilist *list, const void *data)
|
||||
list->nrows = data_get_row_count(list);
|
||||
list->pad = newpad(MAX(list->nrows, 1), list->window_width);
|
||||
if (list->pad == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
/* add the column headers to the window and render all rows to
|
||||
|
@ -234,7 +234,7 @@ WERROR reg_open_samba3(TALLOC_CTX *mem_ctx, struct registry_context **ctx)
|
||||
|
||||
rctx = talloc_zero(mem_ctx, struct samba3_registry_context);
|
||||
if (rctx == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
*ctx = (struct registry_context *)rctx;
|
||||
|
@ -269,7 +269,7 @@ WERROR tree_node_load_children(struct tree_node *node)
|
||||
|
||||
array = talloc_zero_array(node, struct tree_node *, nsubkeys);
|
||||
if (array == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
for (count = 0, i = 0; i < nsubkeys; ++i) {
|
||||
@ -287,7 +287,7 @@ WERROR tree_node_load_children(struct tree_node *node)
|
||||
|
||||
array[count] = tree_node_new(array, node, reg_key_name, key);
|
||||
if (array[count] == NULL) {
|
||||
rv = WERR_NOMEM;
|
||||
rv = WERR_NOT_ENOUGH_MEMORY;
|
||||
goto finish;
|
||||
}
|
||||
++count;
|
||||
|
@ -290,7 +290,7 @@ static WERROR append_data_summary(TALLOC_CTX *ctx, struct value_item *vitem)
|
||||
}
|
||||
tmp = talloc_asprintf(ctx, "(%u) ", (unsigned)len);
|
||||
if (tmp == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
for (i = 0; i < len; ++i) {
|
||||
if (!string_is_printable(a[i])) {
|
||||
@ -309,7 +309,7 @@ static WERROR append_data_summary(TALLOC_CTX *ctx, struct value_item *vitem)
|
||||
(unsigned)i, val);
|
||||
}
|
||||
if (tmp == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -324,7 +324,7 @@ static WERROR append_data_summary(TALLOC_CTX *ctx, struct value_item *vitem)
|
||||
}
|
||||
|
||||
if (tmp == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
vitem->value = tmp;
|
||||
@ -356,7 +356,7 @@ WERROR value_list_load_quick(struct value_list *vl, struct registry_key *key)
|
||||
|
||||
new_items = talloc_zero_array(vl, struct value_item, nvalues);
|
||||
if (new_items == NULL) {
|
||||
return WERR_NOMEM;
|
||||
return WERR_NOT_ENOUGH_MEMORY;
|
||||
}
|
||||
|
||||
for (idx = 0; idx < nvalues; ++idx) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user