diff options
Diffstat (limited to 'hw/xfree86/ddc')
-rw-r--r-- | hw/xfree86/ddc/ddc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/xfree86/ddc/ddc.c b/hw/xfree86/ddc/ddc.c index 7379e959b..2d9d4dcd2 100644 --- a/hw/xfree86/ddc/ddc.c +++ b/hw/xfree86/ddc/ddc.c @@ -102,7 +102,7 @@ resort(unsigned char *s_block) } static int -DDC_checksum(unsigned char *block, int len) +DDC_checksum(const unsigned char *block, int len) { int i, result = 0; int not_null = 0; @@ -149,7 +149,10 @@ GetEDID_DDC1(unsigned int *s_ptr) d_pos++; } free(s_ptr); - if (d_block && DDC_checksum(d_block,EDID1_LEN)) return NULL; + if (d_block && DDC_checksum(d_block,EDID1_LEN)) { + free(d_block); + return NULL; + } return (resort(d_block)); } |