diff options
| author | Ben Pfaff <blp@nicira.com> | 2010-11-03 17:07:33 -0700 |
|---|---|---|
| committer | Ben Pfaff <blp@nicira.com> | 2010-11-03 17:15:39 -0700 |
| commit | b93e69830a5606712f1ec0132e250839afbd87c4 (patch) | |
| tree | c564e088f60a475b71d7a69f3364678e4ed39849 | |
| parent | ee890a619da3544f2d7a30f574f94f2dfd6d975f (diff) | |
| download | openvswitch-b93e69830a5606712f1ec0132e250839afbd87c4.tar.gz | |
CodingStyle: Mention that "free" functions should accept a null pointer.
I've always written OVS code this way, so this just codifies it so that
others know.
| -rw-r--r-- | CodingStyle | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/CodingStyle b/CodingStyle index bbb492e32..2ee189faf 100644 --- a/CodingStyle +++ b/CodingStyle @@ -156,6 +156,12 @@ parameters and their corresponding size parameters should be paired. ... } +Functions that destroy an instance of a dynamically-allocated type +should accept and ignore a null pointer argument. Code that calls +such a function (including the C standard library function free()) +should omit a null-pointer check. We find that this usually makes +code easier to read. + FUNCTION PROTOTYPES |
