comparison lib-src/etags.c @ 70342:f483d24dc1dd

(Perl_functions): Free space allocated for var package. (Erlang_functions): Possibly free space allocated for var last. (Prolog_functions): Possibly free space allocated for var last.
author Francesco Potortì <pot@gnu.org>
date Tue, 02 May 2006 10:14:28 +0000
parents f7ef1c0da4f9
children b442d7e84235 146cd8369025
comparison
equal deleted inserted replaced
70341:15ea16ad6a0e 70342:f483d24dc1dd
39 * If you want to add support for a new language, start by looking at the LUA 39 * If you want to add support for a new language, start by looking at the LUA
40 * language, which is the simplest. Alternatively, consider shipping a 40 * language, which is the simplest. Alternatively, consider shipping a
41 * configuration file containing regexp definitions for etags. 41 * configuration file containing regexp definitions for etags.
42 */ 42 */
43 43
44 char pot_etags_version[] = "@(#) pot revision number is 17.15"; 44 char pot_etags_version[] = "@(#) pot revision number is 17.17";
45 45
46 #define TRUE 1 46 #define TRUE 1
47 #define FALSE 0 47 #define FALSE 0
48 48
49 #ifdef DEBUG 49 #ifdef DEBUG
4541 4541
4542 make_tag (varstart, cp - varstart, FALSE, 4542 make_tag (varstart, cp - varstart, FALSE,
4543 lb.buffer, cp - lb.buffer + 1, lineno, linecharno); 4543 lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
4544 } 4544 }
4545 } 4545 }
4546 free (package);
4546 } 4547 }
4547 4548
4548 4549
4549 /* 4550 /*
4550 * Python support 4551 * Python support
5439 allocated = len + 1; 5440 allocated = len + 1;
5440 strncpy (last, cp, len); 5441 strncpy (last, cp, len);
5441 last[len] = '\0'; 5442 last[len] = '\0';
5442 } 5443 }
5443 } 5444 }
5445 if (last != NULL)
5446 free (last);
5444 } 5447 }
5445 5448
5446 5449
5447 static void 5450 static void
5448 prolog_skip_comment (plb, inf) 5451 prolog_skip_comment (plb, inf)
5595 else if (cp[0] == '"') /* Sometimes, strings start in column one */ 5598 else if (cp[0] == '"') /* Sometimes, strings start in column one */
5596 continue; 5599 continue;
5597 else if (cp[0] == '-') /* attribute, e.g. "-define" */ 5600 else if (cp[0] == '-') /* attribute, e.g. "-define" */
5598 { 5601 {
5599 erlang_attribute (cp); 5602 erlang_attribute (cp);
5600 last = NULL; 5603 if (last != NULL)
5604 {
5605 free (last);
5606 last = NULL;
5607 }
5601 } 5608 }
5602 else if ((len = erlang_func (cp, last)) > 0) 5609 else if ((len = erlang_func (cp, last)) > 0)
5603 { 5610 {
5604 /* 5611 /*
5605 * Function. Store the function name so that we only 5612 * Function. Store the function name so that we only
5612 allocated = len + 1; 5619 allocated = len + 1;
5613 strncpy (last, cp, len); 5620 strncpy (last, cp, len);
5614 last[len] = '\0'; 5621 last[len] = '\0';
5615 } 5622 }
5616 } 5623 }
5624 if (last != NULL)
5625 free (last);
5617 } 5626 }
5618 5627
5619 5628
5620 /* 5629 /*
5621 * A function definition is added if it matches: 5630 * A function definition is added if it matches: