LCOV - code coverage report
Current view: top level - src - free_config.c (source / functions) Coverage Total Hit
Test: coverage.info Lines: 100.0 % 12 12
Test Date: 2026-03-01 04:31:48 Functions: 100.0 % 1 1
Branches: - 0 0

             Branch data     Line data    Source code
       1                 :             : #include "precizer.h"
       2                 :             : 
       3                 :             : /**
       4                 :             :  *
       5                 :             :  * Clean up allocated memory
       6                 :             :  *
       7                 :             :  */
       8                 :         377 : void free_config(void)
       9                 :             : {
      10                 :             :         /// Enable key echo in terminal (return back
      11                 :             :         /// default settings)
      12                 :             :         struct termios term;
      13                 :         377 :         tcgetattr(fileno(stdin),&term);
      14                 :         377 :         term.c_lflag |= (ICANON|ECHO);
      15                 :         377 :         tcsetattr(fileno(stdin),0,&term);
      16                 :             : 
      17                 :         377 :         free(config->running_dir);
      18                 :             : 
      19                 :         377 :         (void)del(conf(db_primary_file_path));
      20                 :             : 
      21                 :         377 :         (void)del(conf(db_file_name));
      22                 :             : 
      23                 :             :         // Free memory of string array
      24                 :         377 :         free_string_array((config)->db_file_names);
      25                 :             : 
      26                 :             :         // Free memory of string array
      27                 :         377 :         free_string_array((config)->ignore);
      28                 :             : 
      29                 :             :         // Free memory of string array
      30                 :         377 :         free_string_array((config)->include);
      31                 :             : 
      32                 :             :         // Free memory of string array
      33                 :         377 :         free_string_array((config)->lock_checksum);
      34                 :         377 : }
        

Generated by: LCOV version 2.0-1