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
b395db8ae9
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/modbus.c

+ 1 - 1
src/modbus.c

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