libDtHelp: Cov 89129 and 88355
authorPeter Howkins <flibble@users.sf.net>
Sat, 11 Aug 2018 00:18:45 +0000 (01:18 +0100)
committerPeter Howkins <flibble@users.sf.net>
Sat, 11 Aug 2018 00:18:45 +0000 (01:18 +0100)
cde/lib/DtHelp/AccessSDL.c

index 8d6d470fc03ab9b25edbd93ced283e39adb26376..1ba55565a9da4c3ce8d451aeb2e085f6a9b8383d 100644 (file)
@@ -1381,8 +1381,11 @@ _DtHelpCeGetSdlDocStamp(
     if (ret_time != NULL)
        *ret_time = timestamp;
 
-    if (result == 0 && (docId == NULL || timestamp == NULL))
+    if (result == 0 && (docId == NULL || timestamp == NULL)) {
+       free(docId);     /* Incase only one of them is NULL */
+       free(timestamp); /*  " */
        return -1;
+    }
 
     return result;
 }