Imported from ../bash-3.0.16.tar.gz.
[platform/upstream/bash.git] / array.c
diff --git a/array.c b/array.c
index 7b0a5d7..bfc83c3 100644 (file)
--- a/array.c
+++ b/array.c
@@ -451,7 +451,7 @@ char        *v;
                         */
                        array_dispose_element(new);
                        free(element_value(ae));
-                       ae->value = savestring(v);
+                       ae->value = v ? savestring(v) : (char *)NULL;
                        return(0);
                } else if (element_index(ae) > i) {
                        ADD_BEFORE(ae, new);