dnp: Fix another segfault that only happens in test mode. (ds620/ds820)

This commit is contained in:
Solomon Peachy 2020-03-18 07:32:13 -04:00
parent 2bb1faefb5
commit 1ddf81255f
1 changed files with 4 additions and 3 deletions

View File

@ -834,6 +834,10 @@ static int dnpds40_attach(void *vctx, struct libusb_device_handle *dev, int type
} else {
return CUPS_BACKEND_FAILED;
}
} else {
ctx->ver_major = 3;
ctx->ver_minor = 0;
ctx->version = strdup("UNKNOWN");
}
/* Per-printer options */
@ -1048,9 +1052,6 @@ static int dnpds40_attach(void *vctx, struct libusb_device_handle *dev, int type
#endif
}
} else {
ctx->ver_major = 3;
ctx->ver_minor = 0;
ctx->version = strdup("UNKNOWN");
switch(ctx->type) {
case P_DNP_DS80D:
ctx->duplex_media = 200;