LCOV - code coverage report
Current view: top level - src/protocol2/rabin - win.c (source / functions) Hit Total Coverage
Test: burp-coverage-clean.info Lines: 13 13 100.0 %
Date: 2016-09-30 Functions: 2 2 100.0 %

          Line data    Source code
       1             : #include "../../burp.h"
       2             : #include "win.h"
       3             : #include "rconf.h"
       4             : #include "../../alloc.h"
       5             : 
       6          33 : struct win *win_alloc(struct rconf *rconf)
       7             : {
       8          33 :         struct win *win=NULL;
       9          33 :         if(!(win=(struct win *)calloc_w(1, sizeof(struct win), __func__))
      10          32 :           || !(win->data=(unsigned char *)calloc_w(
      11          32 :                 1, sizeof(unsigned char)*rconf->win_size, __func__)))
      12           1 :                         win_free(&win);
      13          33 :         return win;
      14             : }
      15             : 
      16             : static void win_free_content(struct win *win)
      17             : {
      18          32 :         if(!win) return;
      19          32 :         free_v((void **)&win->data);
      20             : }
      21             : 
      22          40 : void win_free(struct win **win)
      23             : {
      24          80 :         if(!win || !*win) return;
      25          32 :         win_free_content(*win);
      26          32 :         free_v((void **)win);
      27             : }

Generated by: LCOV version 1.10