tools/tiff2pdf.c:4165: error: Null Dereference
  pointer `currenttime` last assigned on line 4162 could be null and is dereferenced at line 4165, column 5.

tools/tiff2pdf.c:4151:1: start of procedure t2p_pdf_currenttime()
4149.  */
4150. 
4151. void t2p_pdf_currenttime(T2P* t2p)
      ^
4152. {
4153. 	struct tm* currenttime;

tools/tiff2pdf.c:4156:6: Taking false branch
4154. 	time_t timenow;
4155. 
4156. 	if (time(&timenow) == (time_t) -1) {
           ^
4157. 		TIFFError(TIFF2PDF_MODULE,
4158. 			  "Can't get the current time: %s", strerror(errno));

tools/tiff2pdf.c:4162:2: 
4160. 	}
4161. 
4162. 	currenttime = localtime(&timenow);
       ^
4163. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
4164. 		 "D:%.4d%.2d%.2d%.2d%.2d%.2d",

tools/tiff2pdf.c:4163:2: 
4161. 
4162. 	currenttime = localtime(&timenow);
4163. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
       ^
4164. 		 "D:%.4d%.2d%.2d%.2d%.2d%.2d",
4165. 		 (currenttime->tm_year + 1900) % 65536,

void t2p_pdf_currenttime(T2P* t2p)
{
	struct tm* currenttime;
	time_t timenow;
	if (time(&timenow) == (time_t) -1) {
		TIFFError(TIFF2PDF_MODULE,
			  "Can't get the current time: %s", strerror(errno));
		timenow = (time_t) 0;
	}
	currenttime = localtime(&timenow);
	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
		 "D:%.4d%.2d%.2d%.2d%.2d%.2d",
		 (currenttime->tm_year + 1900) % 65536,
		 (currenttime->tm_mon + 1) % 256,
		 (currenttime->tm_mday) % 256,
		 (currenttime->tm_hour) % 256,
		 (currenttime->tm_min) % 256,
		 (currenttime->tm_sec) % 256);
	return;
}
['void t2p_pdf_currenttime(T2P* t2p)\n{\n\tstruct tm* currenttime;\n\ttime_t timenow;\n\tif (time(&timenow) == (time_t) -1) {\n\t\tTIFFError(TIFF2PDF_MODULE,\n\t\t\t  "Can\'t get the current time: %s", strerror(errno));\n\t\ttimenow = (time_t) 0;\n\t}\n\tcurrenttime = localtime(&timenow);\n\tsnprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),\n\t\t "D:%.4d%.2d%.2d%.2d%.2d%.2d",\n\t\t (currenttime->tm_year + 1900) % 65536,\n\t\t (currenttime->tm_mon + 1) % 256,\n\t\t (currenttime->tm_mday) % 256,\n\t\t (currenttime->tm_hour) % 256,\n\t\t (currenttime->tm_min) % 256,\n\t\t (currenttime->tm_sec) % 256);\n\treturn;\n}']