summaryrefslogtreecommitdiff
path: root/src/globals.c
diff options
context:
space:
mode:
authorJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-01-03 22:18:51 +0100
committerJérémie Courrèges-Anglas <jca@wxcvbn.org>2014-01-03 23:06:29 +0100
commitb8d5ca85d9a6e6f42b8dbd6d47cab7bbcffeea90 (patch)
treea64f9b23e4f98279712d3d29bd37659996ce4c39 /src/globals.c
parent268732324fd37d9b001694a9206a66cce6681c20 (diff)
downloadratpoison-b8d5ca85d9a6e6f42b8dbd6d47cab7bbcffeea90.zip
if (ptr) free(ptr) is not a good idiom.
Diffstat (limited to 'src/globals.c')
-rw-r--r--src/globals.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/globals.c b/src/globals.c
index 233f2ae..f81d7ad 100644
--- a/src/globals.c
+++ b/src/globals.c
@@ -108,8 +108,7 @@ set_nselection (char *txt, int len)
int i;
/* Update the selection structure */
- if (selection.text != NULL)
- free(selection.text);
+ free (selection.text);
/* Copy the string by hand. */
selection.text = malloc(len+1);
@@ -125,8 +124,7 @@ void
set_selection (char *txt)
{
/* Update the selection structure */
- if (selection.text != NULL)
- free(selection.text);
+ free (selection.text);
selection.text = xstrdup (txt);
selection.len = strlen (txt);