werror: replace WERR_NOMEM with WERR_NOT_ENOUGH_MEMORY in source3/utils/
authorGünther Deschner <gd@samba.org>
Thu, 3 Dec 2015 14:24:17 +0000 (15:24 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 27 Sep 2016 22:04:19 +0000 (00:04 +0200)
Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/utils/regedit.c
source3/utils/regedit_dialog.c
source3/utils/regedit_hexedit.c
source3/utils/regedit_list.c
source3/utils/regedit_samba3.c
source3/utils/regedit_treeview.c
source3/utils/regedit_valuelist.c

index 83b09b423446084daedc4866c40d74a24fd8707e..88fd74c6c35d7bc41f8996218d02a81e703a9460 100644 (file)
@@ -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;
                        }
                }
 
index 21ec96ccca6cc581c5f9b38a948095b0bce75c6a..dcce66bf20838b2d1685ea50f67387db53dc7f08 100644 (file)
@@ -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;
        }
index d70c521fa67a6c5cbb2a4fc0b351b895e59cbdb1..383736ae2bcd907fc611131a0b4aa808a7962da4 100644 (file)
@@ -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;
                }
index 8ee2d5e95ed71019dcbda67eb4d69d906f2055e8..b5405f286da344ed4f31993d9ab91016e2dd0376 100644 (file)
@@ -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
index 4e22be8fdebfa17c2c883bf92c0cdf6a34a9e3a7..a1f8b39a47d0c10900bf64dc24f149c4ba2bb6e4 100644 (file)
@@ -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;
index f9e4d0a9fd278b00469f4c29f664cb8492feb165..a3df94da04508c3dee994eac3bafcbd528130b17 100644 (file)
@@ -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;
index 76417ce5892abd61d3073e295e6f41285221c666..78ea3fad72b6e56fd676831453bcde645d0c8558 100644 (file)
@@ -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) {