Fix some null pointer problems
This commit is contained in:
parent
2e39fc5618
commit
d2b85dd6af
|
@ -1,6 +1,8 @@
|
||||||
Compton
|
Compton
|
||||||
=======
|
=======
|
||||||
|
|
||||||
|
**This is a development branch, bug to be expected**
|
||||||
|
|
||||||
This is forked from the original Compton because that seems to have become unmaintained. I'll merge pull requests as they appear upstream, as well as trying to fix bugs reported to upstream, or found by myself.
|
This is forked from the original Compton because that seems to have become unmaintained. I'll merge pull requests as they appear upstream, as well as trying to fix bugs reported to upstream, or found by myself.
|
||||||
|
|
||||||
New features are not likely to be added, since I expect compton to become irrelevant in near future.
|
New features are not likely to be added, since I expect compton to become irrelevant in near future.
|
||||||
|
|
|
@ -185,7 +185,7 @@ int win_get_name(session_t *ps, win *w) {
|
||||||
}
|
}
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (strcmp(w->name, strlst[0]) != 0) {
|
if (!w->name || strcmp(w->name, strlst[0]) != 0) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
free(w->name);
|
free(w->name);
|
||||||
w->name = mstrcpy(strlst[0]);
|
w->name = mstrcpy(strlst[0]);
|
||||||
|
@ -208,7 +208,7 @@ int win_get_role(session_t *ps, win *w) {
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (strcmp(w->role, strlst[0]) != 0) {
|
if (!w->role || strcmp(w->role, strlst[0]) != 0) {
|
||||||
ret = 1;
|
ret = 1;
|
||||||
free(w->role);
|
free(w->role);
|
||||||
w->role = mstrcpy(strlst[0]);
|
w->role = mstrcpy(strlst[0]);
|
||||||
|
|
Loading…
Reference in New Issue