Skip to content

Commit 947f457

Browse files
committed
[misc] fix Coverity warnings
1 parent 13dd5df commit 947f457

File tree

7 files changed

+29
-25
lines changed

7 files changed

+29
-25
lines changed

examples/profile.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ long profile_update_file(prf_file_t prf)
299299
retval = errno;
300300
if (retval == 0)
301301
retval = ENOENT;
302+
profile_free_node(state.root_section);
302303
return retval;
303304
}
304305
prf->upd_serial++;
@@ -311,6 +312,7 @@ long profile_update_file(prf_file_t prf)
311312
(syntax_err_cb)(prf->filespec, retval,
312313
state.line_num);
313314
fclose(f);
315+
profile_free_node(state.root_section);
314316
return retval;
315317
}
316318
}

examples/wdi-simple.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
#endif
88

99
VS_VERSION_INFO VERSIONINFO
10-
FILEVERSION 1,5,1,789
11-
PRODUCTVERSION 1,5,1,789
10+
FILEVERSION 1,5,1,790
11+
PRODUCTVERSION 1,5,1,790
1212
FILEFLAGSMASK 0x17L
1313
#ifdef _DEBUG
1414
FILEFLAGS 0x1L
@@ -25,13 +25,13 @@ BEGIN
2525
BEGIN
2626
VALUE "CompanyName", "akeo.ie"
2727
VALUE "FileDescription", "WDI-Simple"
28-
VALUE "FileVersion", "1.5.1.789"
28+
VALUE "FileVersion", "1.5.1.790"
2929
VALUE "InternalName", "WDI-Simple"
3030
VALUE "LegalCopyright", "� 2010-2025 Pete Batard (LGPL v3)"
3131
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/lgpl-3.0.html"
3232
VALUE "OriginalFilename", "wdi-simple.exe"
3333
VALUE "ProductName", "WDI-Simple"
34-
VALUE "ProductVersion", "1.5.1.789"
34+
VALUE "ProductVersion", "1.5.1.790"
3535
VALUE "Comments", "http://libwdi.akeo.ie"
3636
END
3737
END

examples/zadig.c

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,23 +120,24 @@ EXT_DECL(cfg_ext, "sample.cfg", __VA_GROUP__("*.cfg"), __VA_GROUP__("Zadig devic
120120
*/
121121
void w_printf_v(BOOL update_status, const char *format, va_list args)
122122
{
123-
char str[STR_BUFFER_SIZE+2];
123+
char str[STR_BUFFER_SIZE + 2];
124124
int size;
125125
size_t slen;
126126

127127
size = safe_vsnprintf(str, STR_BUFFER_SIZE, format, args);
128128
if (size < 0) {
129-
str[STR_BUFFER_SIZE-1] = 0;
130-
str[STR_BUFFER_SIZE-2] = ']';
131-
str[STR_BUFFER_SIZE-3] = str[STR_BUFFER_SIZE-4] = str[STR_BUFFER_SIZE-5] = '.';
132-
str[STR_BUFFER_SIZE-6] = '[';
129+
str[STR_BUFFER_SIZE - 1] = 0;
130+
str[STR_BUFFER_SIZE - 2] = ']';
131+
str[STR_BUFFER_SIZE - 3] = str[STR_BUFFER_SIZE - 4] = str[STR_BUFFER_SIZE - 5] = '.';
132+
str[STR_BUFFER_SIZE - 6] = '[';
133133
}
134134
slen = safe_strlen(str);
135135
str[slen] = '\r';
136-
str[slen+1] = '\n';
137-
str[slen+2] = 0;
136+
str[slen + 1] = '\n';
137+
str[slen + 2] = 0;
138138

139139
// Also send output to debug logger
140+
// coverity[dont_call]
140141
OutputDebugStringA(str);
141142
// Set cursor to the end of the buffer
142143
Edit_SetSel(hInfo, MAX_LOG_SIZE, MAX_LOG_SIZE);
@@ -407,7 +408,8 @@ int install_driver(void)
407408
if ((pd_options.use_wcid_driver) && (dev != NULL)) {
408409
safe_free(dev->desc);
409410
}
410-
if (need_dealloc) {
411+
if (need_dealloc && (dev != NULL)) {
412+
free(dev->desc);
411413
free(dev);
412414
}
413415
safe_free(inf_name);

examples/zadig.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
#define FIELD_ORANGE RGB(255,240,200)
6161
#define ARROW_GREEN RGB(92,228,65)
6262
#define ARROW_ORANGE RGB(253,143,56)
63-
#define APP_VERSION "Zadig 2.9.789"
63+
#define APP_VERSION "Zadig 2.9.790"
6464

6565
// These are used to flag end users about the driver they are going to replace
6666
enum driver_type {

examples/zadig.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ END
246246
//
247247

248248
VS_VERSION_INFO VERSIONINFO
249-
FILEVERSION 2,9,789,0
250-
PRODUCTVERSION 2,9,789,0
249+
FILEVERSION 2,9,790,0
250+
PRODUCTVERSION 2,9,790,0
251251
FILEFLAGSMASK 0x17L
252252
#ifdef _DEBUG
253253
FILEFLAGS 0x1L
@@ -264,13 +264,13 @@ BEGIN
264264
BEGIN
265265
VALUE "CompanyName", "akeo.ie"
266266
VALUE "FileDescription", "Zadig"
267-
VALUE "FileVersion", "2.9.789"
267+
VALUE "FileVersion", "2.9.790"
268268
VALUE "InternalName", "Zadig"
269269
VALUE "LegalCopyright", "� 2010-2025 Pete Batard (GPL v3)"
270270
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/gpl-3.0.html"
271271
VALUE "OriginalFilename", "zadig.exe"
272272
VALUE "ProductName", "Zadig"
273-
VALUE "ProductVersion", "2.9.789"
273+
VALUE "ProductVersion", "2.9.790"
274274
VALUE "Comments", "https://zadig.akeo.ie"
275275
END
276276
END

libwdi/installer.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,12 +104,12 @@ void plog_v(const char *format, va_list args)
104104

105105
buffer[0] = IC_PRINT_MESSAGE;
106106

107-
size = safe_vsnprintf(buffer+1, STR_BUFFER_SIZE-1, format, args);
107+
size = safe_vsnprintf(buffer + 1, STR_BUFFER_SIZE - 1, format, args);
108108
if (size < 0) {
109-
buffer[STR_BUFFER_SIZE-1] = 0;
110-
size = STR_BUFFER_SIZE-2;
109+
buffer[STR_BUFFER_SIZE - 1] = 0;
110+
size = STR_BUFFER_SIZE - 2;
111111
}
112-
WriteFile(pipe_handle, buffer, (DWORD)size+2, &junk, NULL);
112+
WriteFile(pipe_handle, buffer, (DWORD)min(size + 2, STR_BUFFER_SIZE), &junk, NULL);
113113
}
114114

115115
void plog(const char *format, ...)

libwdi/libwdi.rc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ END
5050
//
5151

5252
VS_VERSION_INFO VERSIONINFO
53-
FILEVERSION 1,5,1,789
54-
PRODUCTVERSION 1,5,1,789
53+
FILEVERSION 1,5,1,790
54+
PRODUCTVERSION 1,5,1,790
5555
FILEFLAGSMASK 0x17L
5656
#ifdef _DEBUG
5757
FILEFLAGS 0x1L
@@ -68,13 +68,13 @@ BEGIN
6868
BEGIN
6969
VALUE "CompanyName", "akeo.ie"
7070
VALUE "FileDescription", "libwdi: Windows Driver Installer Library"
71-
VALUE "FileVersion", "1.5.1.789"
71+
VALUE "FileVersion", "1.5.1.790"
7272
VALUE "InternalName", "libwdi"
7373
VALUE "LegalCopyright", "� 2010-2025 Pete Batard (LGPL v3)"
7474
VALUE "LegalTrademarks", "https://www.gnu.org/licenses/lgpl-3.0.html"
7575
VALUE "OriginalFilename", "libwdi"
7676
VALUE "ProductName", "libwdi"
77-
VALUE "ProductVersion", "1.5.1.789"
77+
VALUE "ProductVersion", "1.5.1.790"
7878
VALUE "Comments", "http://libwdi.akeo.ie"
7979
END
8080
END

0 commit comments

Comments
 (0)