summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/session.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/session.c b/src/session.c
index 1531626..a908efc 100644
--- a/src/session.c
+++ b/src/session.c
@@ -744,23 +744,23 @@ SaveYourselfPhase2CB (SmcConn smcConn2, SmPointer clientData _X_UNUSED)
char userId[20];
char hint = SmRestartIfRunning;
- prop1.name = SmProgram;
- prop1.type = SmARRAY8;
+ prop1.name = strdup(SmProgram);
+ prop1.type = strdup(SmARRAY8);
prop1.num_vals = 1;
prop1.vals = &prop1val;
prop1val.value = Argv[0];
prop1val.length = (int)strlen (Argv[0]);
snprintf (userId, sizeof(userId), "%ld", (long)getuid());
- prop2.name = SmUserID;
- prop2.type = SmARRAY8;
+ prop2.name = strdup(SmUserID);
+ prop2.type = strdup(SmARRAY8);
prop2.num_vals = 1;
prop2.vals = &prop2val;
prop2val.value = (SmPointer) userId;
prop2val.length = (int)strlen (userId);
- prop3.name = SmRestartStyleHint;
- prop3.type = SmCARD8;
+ prop3.name = strdup(SmRestartStyleHint);
+ prop3.type = strdup(SmCARD8);
prop3.num_vals = 1;
prop3.vals = &prop3val;
prop3val.value = (SmPointer) &hint;
@@ -828,8 +828,8 @@ SaveYourselfPhase2CB (SmcConn smcConn2, SmPointer clientData _X_UNUSED)
}
}
- prop1.name = SmRestartCommand;
- prop1.type = SmLISTofARRAY8;
+ prop1.name = strdup(SmRestartCommand);
+ prop1.type = strdup(SmLISTofARRAY8);
prop1.vals = malloc ((size_t)(Argc + 4) * sizeof (SmPropValue));
@@ -855,23 +855,23 @@ SaveYourselfPhase2CB (SmcConn smcConn2, SmPointer clientData _X_UNUSED)
}
}
- prop1.vals[numVals].value = (SmPointer) "-clientId";
+ prop1.vals[numVals].value = strdup("-clientId");
prop1.vals[numVals++].length = 9;
- prop1.vals[numVals].value = (SmPointer) twm_clientId;
+ prop1.vals[numVals].value = strdup(twm_clientId);
prop1.vals[numVals++].length = (int)strlen (twm_clientId);
- prop1.vals[numVals].value = (SmPointer) "-restore";
+ prop1.vals[numVals].value = strdup("-restore");
prop1.vals[numVals++].length = 8;
- prop1.vals[numVals].value = (SmPointer) filename;
+ prop1.vals[numVals].value = strdup(filename);
prop1.vals[numVals++].length = (int)strlen (filename);
prop1.num_vals = numVals;
snprintf (discardCommand, sizeof(discardCommand), "rm %s", filename);
- prop2.name = SmDiscardCommand;
- prop2.type = SmARRAY8;
+ prop2.name = strdup(SmDiscardCommand);
+ prop2.type = strdup(SmARRAY8);
prop2.num_vals = 1;
prop2.vals = &prop2val;
prop2val.value = (SmPointer) discardCommand;