Skip to content

Commit

Permalink
Fix: Potentially uninitialized local variable
Browse files Browse the repository at this point in the history
A local non-static variable of a non-class type has an undefined value before it is initialized. For example, it is incorrect to rely on an uninitialized integer to have the value `0`.

Fixed by removing the unused variable completely.
  • Loading branch information
Kraemii committed May 22, 2023
1 parent 00741ed commit 0ddb632
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions wmi/wmirsop.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ wmi_connect_rsop (int argc, char **argv)
struct com_context *ctx = NULL;
NTSTATUS status;
struct IWbemServices *pWS = NULL;
uint32_t *ret_code;

struct IWbemClassObject *wco = NULL;
struct IWbemClassObject *inc, *outc, *in;
Expand Down Expand Up @@ -193,12 +192,6 @@ wmi_connect_rsop (int argc, char **argv)
NULL);
WERR_CHECK("IWbemServices_ExecMethod.");

if(ret_code){
result = WbemClassObject_Get(out->object_data, ctx, "nameSpace", 0, &v,
0, 0);
WERR_CHECK("IWbemClassObject_Put(CommandLine).");
}

/* Computer namespace only, user namespace doesn't seem to work */
namespace = talloc_asprintf_append(v.v_string, "%s", "\\computer");
result = WBEM_ConnectServer(ctx, args.hostname, namespace, 0, 0, 0, 0, 0, 0, &pWS);
Expand Down

0 comments on commit 0ddb632

Please sign in to comment.