unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Problem report #45
@ 2006-04-30 16:43 Dan Nicolaescu
  2006-05-02 16:47 ` Dan Nicolaescu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Nicolaescu @ 2006-04-30 16:43 UTC (permalink / raw)



CID: 45
Checker: RESOURCE_LEAK (help)
File: emacs/lib-src/etags.c
Function: Erlang_functions
Description: Returned without freeing storage "last"

5575 	static void
5576 	Erlang_functions (inf)
5577 	     FILE *inf;
5578 	{
5579 	  char *cp, *last;
5580 	  int len;
5581 	  int allocated;
5582 	
5583 	  allocated = 0;
5584 	  len = 0;
5585 	  last = NULL;
5586 	

At conditional (1): "feof == 0" taking true path
At conditional (2): "((readline), (cp = (lb).buffer)), (1 != 0)" taking true path
At conditional (4): "feof == 0" taking false path

5587 	  LOOP_ON_INPUT_LINES (inf, lb, cp)
5588 	    {

At conditional (3): "*(cp + 0) == 0" taking true path

5589 	      if (cp[0] == '\0')	/* Empty line */
5590 		continue;
5591 	      else if (iswhite (cp[0])) /* Not function nor attribute */
5592 		continue;
5593 	      else if (cp[0] == '%')	/* comment */
5594 		continue;
5595 	      else if (cp[0] == '"')	/* Sometimes, strings start in column one */
5596 		continue;
5597 	      else if (cp[0] == '-') 	/* attribute, e.g. "-define" */
5598 		{
5599 		  erlang_attribute (cp);
5600 		  last = NULL;
5601 		}

Event pass_arg: Variable "last" not freed or pointed-to in function "erlang_func" [model]
Also see events: [alloc_fn][var_assign][pass_arg][leaked_storage]

5602 	      else if ((len = erlang_func (cp, last)) > 0)
5603 		{
5604 		  /*
5605 		   * Function.  Store the function name so that we only
5606 		   * generates a tag for the first clause.
5607 		   */
5608 		  if (last == NULL)

Event alloc_fn: Called allocation function "xmalloc" [model]
Event var_assign: Assigned variable "last" to storage returned from "xmalloc"
Also see events: [var_assign][pass_arg][pass_arg][leaked_storage]

5609 		    last = xnew (len + 1, char);
5610 		  else if (len + 1 > allocated)
5611 		    xrnew (last, len + 1, char);
5612 		  allocated = len + 1;

Event pass_arg: Variable "last" not freed or pointed-to in function "strncpy"
Also see events: [alloc_fn][var_assign][pass_arg][leaked_storage]

5613 		  strncpy (last, cp, len);
5614 		  last[len] = '\0';
5615 		}
5616 	    }

Event leaked_storage: Returned without freeing storage "last"
Also see events: [alloc_fn][var_assign][pass_arg][pass_arg]

5617 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Problem report #45
  2006-04-30 16:43 Problem report #45 Dan Nicolaescu
@ 2006-05-02 16:47 ` Dan Nicolaescu
  0 siblings, 0 replies; 2+ messages in thread
From: Dan Nicolaescu @ 2006-05-02 16:47 UTC (permalink / raw)


This was analyzed by Francesco Potorti`, so there's no need to look at it.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-05-02 16:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-30 16:43 Problem report #45 Dan Nicolaescu
2006-05-02 16:47 ` Dan Nicolaescu

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).