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

tools/tiff2pdf.c:4241:1: start of procedure t2p_pdf_currenttime()
4239.  */
4240. 
4241. void t2p_pdf_currenttime(T2P* t2p)
      ^
4242. {
4243. 	struct tm* currenttime;

tools/tiff2pdf.c:4246:6: Taking false branch
4244. 	time_t timenow;
4245. 
4246. 	if (time(&timenow) == (time_t) -1) {
           ^
4247. 		TIFFError(TIFF2PDF_MODULE,
4248. 			  "Can't get the current time: %s", strerror(errno));

tools/tiff2pdf.c:4252:2: 
4250. 	}
4251. 
4252. 	currenttime = localtime(&timenow);
       ^
4253. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
4254. 		 "D:%.4u%.2u%.2u%.2u%.2u%.2u",

tools/tiff2pdf.c:4255:4: 
4253. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
4254. 		 "D:%.4u%.2u%.2u%.2u%.2u%.2u",
4255. 		 TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),
         ^
4256. 		 TIFFmin((unsigned) currenttime->tm_mon + 1U,12U),   /* 0-11 + 1 */
4257. 		 TIFFmin((unsigned) currenttime->tm_mday,31U),       /* 1-31 */

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:%.4u%.2u%.2u%.2u%.2u%.2u",
		 TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),
		 TIFFmin((unsigned) currenttime->tm_mon + 1U,12U),
		 TIFFmin((unsigned) currenttime->tm_mday,31U),
		 TIFFmin((unsigned) currenttime->tm_hour,23U),
		 TIFFmin((unsigned) currenttime->tm_min,59U),
		 TIFFmin((unsigned) (currenttime->tm_sec),60U));
	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:%.4u%.2u%.2u%.2u%.2u%.2u",\n\t\t TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),\n\t\t TIFFmin((unsigned) currenttime->tm_mon + 1U,12U),\n\t\t TIFFmin((unsigned) currenttime->tm_mday,31U),\n\t\t TIFFmin((unsigned) currenttime->tm_hour,23U),\n\t\t TIFFmin((unsigned) currenttime->tm_min,59U),\n\t\t TIFFmin((unsigned) (currenttime->tm_sec),60U));\n\treturn;\n}']