last segfault fix from me. Bug report with 2 backtraces can be found here: https://bugzilla.redhat.com/show_bug.cgi?id=766215
However there is no reproducer and I wasn't able to test proposed patch.
I've removed the "if (current_plot)" condition because it seems irrelevant and if current_plot is false, new_cmap->pixels variable won't be allocated, what could lead to given segfaults. But of course, this can be incorrect solution, so please be cautious when reviewing this patch.