dnpds40: Fix a use-after-free.

This commit is contained in:
Solomon Peachy 2014-10-07 07:58:39 -04:00
parent 508e4051ae
commit 325cf58e0d

View file

@ -43,7 +43,7 @@
#include "backend_common.h"
#define USB_VID_DNP 0x1343
#define USB_PID_CITIZEN_CW01 0x0002 // Maybe others?
//#define USB_PID_CITIZEN_CW01 0x0002 // Maybe others?
#define USB_PID_DNP_DS40 0x0003 // Also Citizen CX
#define USB_PID_DNP_DS80 0x0004 // Also Citizen CX-W
#define USB_PID_DNP_DSRX1 0x0005 // Also Citizen CY
@ -521,8 +521,8 @@ top:
sleep(1);
goto top;
}
free(resp);
ERROR("Printer Status: %s\n", dnpds40_statuses((char*)resp));
free(resp);
return CUPS_BACKEND_RETRY_CURRENT;
}
@ -994,7 +994,7 @@ static int dnpds40_cmdline_arg(void *vctx, int argc, char **argv)
/* Exported */
struct dyesub_backend dnpds40_backend = {
.name = "DNP DS40/DS80/DSRX1",
.version = "0.32a",
.version = "0.32",
.uri_prefix = "dnpds40",
.cmdline_usage = dnpds40_cmdline,
.cmdline_arg = dnpds40_cmdline_arg,
@ -1008,10 +1008,13 @@ struct dyesub_backend dnpds40_backend = {
{ USB_VID_DNP, USB_PID_DNP_DS40, P_DNP_DS40, ""},
{ USB_VID_DNP, USB_PID_DNP_DS80, P_DNP_DS80, ""},
{ USB_VID_DNP, USB_PID_DNP_DSRX1, P_DNP_DS40, ""},
{ USB_VID_DNP, USB_PID_CITIZEN_CW01, P_DNP_DS40, ""},
// These aren't likely to be compatible
// { USB_VID_DNP, USB_PID_CITIZEN_CW01, P_DNP_DS40, ""},
// { USB_VID_CITIZEN, USB_PID_OLMEC_OP900, P_DNP_DS40, ""},
// { USB_VID_CITIZEN, USB_PID_CITIZEN_CW-02, P_DNP_DS40, ""},
// { USB_VID_CITIZEN, USB_PID_CITIZEN_OP900II, P_DNP_DS40, ""},
// { USB_VID_CITIZEN, USB_PID_OLMEC_OP900, P_DNP_DS40, ""},
// { USB_VID_MITSU, USB_PID_MITSU_CP38000W, P_DNP_DS80, ""},
{ 0, 0, 0, ""}
}