PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - ext/ereg/regex - regfree.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 15 17 88.2 %
Date: 2014-10-22 Functions: 1 1 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : #include <sys/types.h>
       2             : #include <stdio.h>
       3             : #include <stdlib.h>
       4             : 
       5             : #include "regex.h"
       6             : #include "utils.h"
       7             : #include "regex2.h"
       8             : 
       9             : /*
      10             :  - regfree - free everything
      11             :  = API_EXPORT(void) regfree(regex_t *);
      12             :  */
      13             : API_EXPORT(void)
      14         393 : regfree(preg)
      15             : regex_t *preg;
      16             : {
      17             :         register struct re_guts *g;
      18             : 
      19         393 :         if (preg->re_magic != MAGIC1)        /* oops */
      20           0 :                 return;                 /* nice to complain, but hard */
      21             : 
      22         393 :         g = preg->re_g;
      23         393 :         if (g == NULL || g->magic != MAGIC2) /* oops again */
      24           0 :                 return;
      25         393 :         preg->re_magic = 0;          /* mark it invalid */
      26         393 :         g->magic = 0;                        /* mark it invalid */
      27             : 
      28         393 :         if (g->strip != NULL)
      29         393 :                 free((char *)g->strip);
      30         393 :         if (g->sets != NULL)
      31         162 :                 free((char *)g->sets);
      32         393 :         if (g->setbits != NULL)
      33         162 :                 free((char *)g->setbits);
      34         393 :         if (g->must != NULL)
      35         107 :                 free(g->must);
      36         393 :         free((char *)g);
      37             : }

Generated by: LCOV version 1.10

Generated at Wed, 22 Oct 2014 07:24:48 +0000 (36 minutes ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.