Commit c9106fdb9ce7420bb01eb4897bd3e90682f5e149
1 parent
d9d1b507
Fix OMG bug in modbus_mapping_free not freeing memory
Thanks to Stefan Finzel for the bug report
Showing
1 changed file
with
1 additions
and
1 deletions
src/modbus.c
| ... | ... | @@ -1561,7 +1561,7 @@ modbus_mapping_t* modbus_mapping_new(int nb_bits, int nb_input_bits, |
| 1561 | 1561 | /* Frees the 4 arrays */ |
| 1562 | 1562 | void modbus_mapping_free(modbus_mapping_t *mb_mapping) |
| 1563 | 1563 | { |
| 1564 | - if (mb_mapping != NULL) { | |
| 1564 | + if (mb_mapping == NULL) { | |
| 1565 | 1565 | return; |
| 1566 | 1566 | } |
| 1567 | 1567 | ... | ... |