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



This is the last one, all the problem reports that still need to be
analyzed have been posted here now.

CID: 49
Checker: RESOURCE_LEAK (help)
File: emacs/lib-src/etags.c
Function: Prolog_functions
Description: Variable "last" not freed or pointed-to in function "strncpy"

5411 	static void
5412 	Prolog_functions (inf)
5413 	     FILE *inf;
5414 	{
5415 	  char *cp, *last;
5416 	  int len;
5417 	  int allocated;
5418 	
5419 	  allocated = 0;
5420 	  len = 0;
5421 	  last = NULL;
5422 	

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

5423 	  LOOP_ON_INPUT_LINES (inf, lb, cp)
5424 	    {

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

5425 	      if (cp[0] == '\0')	/* Empty line */
5426 		continue;
5427 	      else if (iswhite (cp[0])) /* Not a predicate */
5428 		continue;
5429 	      else if (cp[0] == '/' && cp[1] == '*')	/* comment. */
5430 		prolog_skip_comment (&lb, inf);
5431 	      else if ((len = prolog_pr (cp, last)) > 0)
5432 		{
5433 		  /* Predicate or rule.  Store the function name so that we
5434 		     only generate a tag for the first clause.  */
5435 		  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][leaked_storage][pass_arg]

5436 		    last = xnew(len + 1, char);
5437 		  else if (len + 1 > allocated)
5438 		    xrnew (last, len + 1, char);
5439 		  allocated = len + 1;

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

5440 		  strncpy (last, cp, len);
5441 		  last[len] = '\0';
5442 		}
5443 	    }

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

5444 	}

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

* Re: Problem report #49
  2006-04-30 16:49 Problem report #49 Dan Nicolaescu
@ 2006-05-02 16:44 ` Dan Nicolaescu
  2006-05-02 16:46 ` Dan Nicolaescu
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Nicolaescu @ 2006-05-02 16:44 UTC (permalink / raw)



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

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

* Re: Problem report #49
  2006-04-30 16:49 Problem report #49 Dan Nicolaescu
  2006-05-02 16:44 ` Dan Nicolaescu
@ 2006-05-02 16:46 ` Dan Nicolaescu
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Nicolaescu @ 2006-05-02 16:46 UTC (permalink / raw)


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

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

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

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-04-30 16:49 Problem report #49 Dan Nicolaescu
2006-05-02 16:44 ` Dan Nicolaescu
2006-05-02 16:46 ` 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).