소스 검색

Fix OMG bug in modbus_mapping_free not freeing memory

Thanks to Stefan Finzel for the bug report
Stéphane Raimbault 13 년 전
부모
커밋
c9106fdb9c
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  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;
     }