add: if (!WMIsPLArray(array) || WMGetPropListItemCount(array)==0) { if (prefs->swtileImage) RReleaseImage(prefs->swtileImage); prefs->swtileImage= NULL;  WMReleasePropList(array); return 0; }
context: setSwPOptions(WScreen *scr, WDefaultEntry *entry, WMPropList *array, void *foo){    char *path;    RImage *bgimage;    int cwidth, cheight;    WPreferences *prefs= (WPreferences*)foo;    switch (WMGetPropListItemCount(array))    {    case 4:        if (!WMIsPLString(WMGetFromPLArray(array, 1))) {            wwarning(_("Invalid arguments for option \"%s\""),                     entry->key);            break;        } else          path= FindImage(wPreferences.pixmap_path, WMGetFromPLString(WMGetFromPLArray(array, 1)));        if (!path) {            wwarning(_("Could not find image \"%s\" for option \"%s\""),                      WMGetFromPLString(WMGetFromPLArray(array, 1)),                     entry->key);        } else {            bgimage= RLoadImage(scr->rcontext, path, 0);            if (!bgimage) {                wwarning(_("Could not load image \"%s\" for option \"%s\""),                          path, entry->key);                wfree(path);            } else {                wfree(path);                            cwidth= atoi(WMGetFromPLString(WMGetFromPLArray(array, 2)));                cheight= atoi(WMGetFromPLString(WMGetFromPLArray(array, 3)));                if (cwidth <= 0 || cheight <= 0 ||                    cwidth >= bgimage->width - 2 ||                    cheight >= bgimage->height - 2)                    wwarning(_("Invalid split sizes for SwitchPanel back image."));                else {                    int i;                    int swidth, theight;                    for (i= 0; i < 9; i++) {                        if (prefs->swbackImage[i])                          RReleaseImage(prefs->swbackImage[i]);                        prefs->swbackImage[i]= NULL;                    }                    swidth= (bgimage->width - cwidth) / 2;                    theight= (bgimage->height - cheight) / 2;                    prefs->swbackImage[0]= chopOffImage(bgimage, 0, 0,                                                        swidth, theight);                    prefs->swbackImage[1]= chopOffImage(bgimage, swidth, 0,                                                        cwidth, theight);                    prefs->swbackImage[2]= chopOffImage(bgimage, swidth+cwidth, 0,                                                        swidth, theight);                    prefs->swbackImage[3]= chopOffImage(bgimage, 0, theight,                                                        swidth, cheight);                    prefs->swbackImage[4]= chopOffImage(bgimage, swidth, theight,                                                        cwidth, cheight);                    prefs->swbackImage[5]= chopOffImage(bgimage, swidth+cwidth, theight,                                                        swidth, cheight);                    prefs->swbackImage[6]= chopOffImage(bgimage, 0, theight+cheight,                                                        swidth, theight);                    prefs->swbackImage[7]= chopOffImage(bgimage, swidth, theight+cheight,                                                        cwidth, theight);                    prefs->swbackImage[8]= chopOffImage(bgimage, swidth+cwidth, theight+cheight,                                                        swidth, theight);                    // check if anything failed                    for (i= 0; i < 9; i++) {                        if (!prefs->swbackImage[i]) {                            for (; i>=0; --i) {                                RReleaseImage(prefs->swbackImage[i]);                                prefs->swbackImage[i]= NULL;                            }                            break;                        }                    }                }                RReleaseImage(bgimage);            }        }    case 1:        if (!WMIsPLString(WMGetFromPLArray(array, 0))) {            wwarning(_("Invalid arguments for option \"%s\""),                     entry->key);            break;        } else          path= FindImage(wPreferences.pixmap_path, WMGetFromPLString(WMGetFromPLArray(array, 0)));        if (!path) {            wwarning(_("Could not find image \"%s\" for option \"%s\""),                      WMGetFromPLString(WMGetFromPLArray(array, 0)),                     entry->key);        } else {            if (prefs->swtileImage) RReleaseImage(prefs->swtileImage);            prefs->swtileImage= RLoadImage(scr->rcontext, path, 0);            if (!prefs->swtileImage) {                wwarning(_("Could not load image \"%s\" for option \"%s\""),                          path, entry->key);            }            wfree(path);        }        break;    default:        wwarning(_("Invalid number of arguments for option \"%s\""),                 entry->key);        break;    }    WMReleasePropList(array);            return 0;}