Browse Source

Fix OMG bug in modbus_mapping_free not freeing memory

Thanks to Stefan Finzel for the bug report
Stéphane Raimbault 13 years ago
parent
commit
c9106fdb9c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modbus.c

+ 1 - 1
src/modbus.c

@@ -1561,7 +1561,7 @@ modbus_mapping_t* modbus_mapping_new(int nb_bits, int nb_input_bits,
 /* Frees the 4 arrays */
 void modbus_mapping_free(modbus_mapping_t *mb_mapping)
 {
-    if (mb_mapping != NULL) {
+    if (mb_mapping == NULL) {
         return;
     }