emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

problem report #104


From: Dan Nicolaescu
Subject: problem report #104
Date: Mon, 1 Dec 2008 09:05:16 -0800 (PST)

CID: 104
Checker: NULL_RETURNS (help)
File: emacs/lib-src/make-docfile.c
Function: scan_lisp_file
Description: Dereferencing NULL value "saved_string"

Event returned_null: Function "malloc" returned NULL value (checked 29 out of 
36 times)
Event var_assigned: Variable "saved_string" assigned to NULL return value from 
"malloc"
Also see events: [var_assigned][dereference][dereference]

912                   saved_string = (char *) malloc (length);

At conditional (1): "i < length" taking true path

913                   for (i = 0; i < length; i++)

Event dereference: Dereferencing NULL value "saved_string"
Also see events: [returned_null][var_assigned][dereference]

914                     saved_string[i] = getc (infile);
915                   /* The last character is a ^_.
916                      That is needed in the .elc file
917                      but it is redundant in DOC.  So get rid of it here.  */

Event dereference: Dereferencing NULL value "saved_string"
Also see events: [returned_null][var_assigned][dereference]

918                   saved_string[length - 1] = 0;
919                   /* Skip the line break.  */
920                   while (c == '\n' && c == '\r')
921                     c = getc (infile);
922                   /* Skip the following line.  */
923                   while (c != '\n' && c != '\r')
924                     c = getc (infile);
925                 }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]