ddc: Fix memory leak in GetEDID_DDC1
Mark argument to DDC_checksum as const too. Signed-off-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
750d4e82a0
commit
7e0575baf1
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user